Add lint docker image for golang linting and testing to individual package subdirs

Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
This commit is contained in:
Riyaz Faizullabhoy
2016-12-19 16:34:57 -08:00
parent 51088ee491
commit b73d2a29a7
7 changed files with 78 additions and 12 deletions

View File

@@ -37,14 +37,6 @@ hyperkit.git/build/com.docker.hyperkit: hyperkit.git
hyperkit: hyperkit.sh hyperkit.git/build/com.docker.hyperkit alpine/initrd.img alpine/kernel/x86_64/vmlinuz64
sudo ./hyperkit.sh
lint:
# gofmt
@test -z "$$(gofmt -s -l .| grep -v .pb. | grep -v */vendor/ | tee /dev/stderr)"
# govet
@test -z "$$(go tool vet -printf=false . 2>&1 | grep -v */vendor/ | tee /dev/stderr)"
# golint
@test -z "$(shell find . -type f -name "*.go" -not -path "*/vendor/*" -not -name "*.pb.*" -exec golint {} \; | tee /dev/stderr)"
test: Dockerfile.test alpine/initrd-test.img alpine/kernel/x86_64/vmlinuz64
$(MAKE) -C alpine
BUILD=$$( tar cf - $^ | docker build -f Dockerfile.test -q - ) && \
@@ -101,7 +93,7 @@ ci:
$(MAKE) AUFS=1 test
$(MAKE) AUFS=1 media
ci-pr: lint
ci-pr:
$(MAKE) clean
$(MAKE) all
$(MAKE) test