From 0c9f1efc75e81e3c1b97fea53e5285e6800e17e9 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 8 Dec 2014 16:10:29 +0100 Subject: [PATCH] Run vet and lint during build --- build.sh | 8 ++++++-- docker/Dockerfile | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index b3f4fddc4..3cb8f721b 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ set -euo pipefail IFS=$'\n\t' -DOCKERIMGV=1.4-1 +DOCKERIMGV=1.4-2 case "${1:-default}" in default) @@ -113,7 +113,11 @@ case "${1:-default}" in -v $(pwd):/go/src/github.com/syncthing/syncthing \ -w /go/src/github.com/syncthing/syncthing \ syncthing/build:$DOCKERIMGV \ - sh -c './build.sh clean && ./build.sh all && STTRACE=all ./build.sh test-cov' + sh -c './build.sh clean \ + && go vet ./cmd/... ./internal/... \ + && ( golint ./cmd/... ; golint ./internal/... ) | egrep -v "comment on exported|should have comment" \ + && ./build.sh all \ + && STTRACE=all ./build.sh test-cov' ;; docker-test) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8f015f1db..db2bcd2a7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -51,6 +51,11 @@ RUN go get github.com/tools/godep \ && go get github.com/axw/gocov/gocov \ && go get github.com/AlekSi/gocov-xml +# Install tools "go vet" and "golint" + +RUN go get golang.org/x/tools/cmd/vet \ + && go get github.com/golang/lint/golint + # Build standard library for race RUN go install -race std