Run vet and lint during build

This commit is contained in:
Jakob Borg 2014-12-08 16:10:29 +01:00
parent 665b4506e7
commit 0c9f1efc75
2 changed files with 11 additions and 2 deletions

View File

@ -2,7 +2,7 @@
set -euo pipefail set -euo pipefail
IFS=$'\n\t' IFS=$'\n\t'
DOCKERIMGV=1.4-1 DOCKERIMGV=1.4-2
case "${1:-default}" in case "${1:-default}" in
default) default)
@ -113,7 +113,11 @@ case "${1:-default}" in
-v $(pwd):/go/src/github.com/syncthing/syncthing \ -v $(pwd):/go/src/github.com/syncthing/syncthing \
-w /go/src/github.com/syncthing/syncthing \ -w /go/src/github.com/syncthing/syncthing \
syncthing/build:$DOCKERIMGV \ 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) docker-test)

View File

@ -51,6 +51,11 @@ RUN go get github.com/tools/godep \
&& go get github.com/axw/gocov/gocov \ && go get github.com/axw/gocov/gocov \
&& go get github.com/AlekSi/gocov-xml && 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 # Build standard library for race
RUN go install -race std RUN go install -race std