grim/convey

384f73205039
Parents 71cc01d7f292
Children 5f61191295a9
move to using gometalinter, still some issues with it
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/images/gometalinter/Dockerfile Mon Feb 19 01:56:31 2018 -0600
@@ -0,0 +1,9 @@
+FROM golang:1.10-stretch
+
+RUN set -ex && \
+ go get -u -v gopkg.in/alecthomas/gometalinter.v2 && \
+ gometalinter.v2 --install
+
+COPY run.sh /
+
+ENTRYPOINT ["/run.sh"]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/images/gometalinter/README.md Mon Feb 19 01:56:31 2018 -0600
@@ -0,0 +1,22 @@
+# convey/go-vet
+
+The gometalinter image will run
+[gometalinter](https://github.com/alecthomas/gometalinter) on all of the
+packages in the specified package.
+
+## Example
+
+ tasks:
+ linter:
+ type: docker/run
+ image: convey/gometalinter:latest
+ environment:
+ - GO_PACKAGE=bitbucket.org/rw_grim/convey
+
+## Environment Variables
+
+`GO_PACKAGE` if set, will put the root of the workspace into the correct path
+and run gometalinter on all packages in the package.
+
+`GOMETALINTER_OPTIONS` additional options to pass to gometalinter.
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/images/gometalinter/run.sh Mon Feb 19 01:56:31 2018 -0600
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -ex
+
+if [ -n ${GO_PACKAGE} ] ; then
+ _PACKAGE_PATH="/go/src/${GO_PACKAGE}"
+ _PARENT=$(dirname ${_PACKAGE_PATH})
+ mkdir -p ${_PARENT}
+ ln -s ${CONVEY_WORKSPACE} ${_PACKAGE_PATH}
+ cd ${_PACKAGE_PATH}
+fi
+
+gometalinter.v2 --vendor ${GOMETALINTER_OPTIONS} ./...
+