Fixed the go vet to skip vendored files

This commit is contained in:
Diptanu Choudhury 2016-02-15 17:56:28 -08:00
parent 3192c332f1
commit 35ab48bc3d
1 changed files with 5 additions and 3 deletions

View File

@ -9,6 +9,8 @@ EXTERNAL_TOOLS=\
github.com/axw/gocov/gocov \
gopkg.in/matm/v1/gocov-html
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
all: test
dev: format
@ -39,14 +41,14 @@ vet:
@go tool vet 2>/dev/null ; if [ $$? -eq 3 ]; then \
go get golang.org/x/tools/cmd/vet; \
fi
@echo "--> Running go tool vet $(VETARGS) ."
@go tool vet $(VETARGS) . ; if [ $$? -eq 1 ]; then \
@echo "--> Running go tool vet $(VETARGS) ${GOFILES_NOVENDOR}"
@go tool vet $(VETARGS) ${GOFILES_NOVENDOR} ; if [ $$? -eq 1 ]; then \
echo ""; \
echo "[LINT] Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
fi
@git grep -n `echo "log"".Print"` ; if [ $$? -eq 0 ]; then \
@git grep -n `echo "log"".Print"` | grep -v 'vendor/' ; if [ $$? -eq 0 ]; then \
echo "[LINT] Found "log"".Printf" calls. These should use Nomad's logger instead."; \
fi