commit
ef1f2d5e71
16
Makefile
16
Makefile
|
@ -1,4 +1,5 @@
|
||||||
TEST?=./...
|
TEST?=./...
|
||||||
|
VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
|
||||||
|
|
||||||
default: test
|
default: test
|
||||||
|
|
||||||
|
@ -10,6 +11,7 @@ dev: generate
|
||||||
|
|
||||||
test: generate
|
test: generate
|
||||||
TF_ACC= go test $(TEST) $(TESTARGS) -timeout=10s -parallel=4
|
TF_ACC= go test $(TEST) $(TESTARGS) -timeout=10s -parallel=4
|
||||||
|
@$(MAKE) vet
|
||||||
|
|
||||||
testacc: generate
|
testacc: generate
|
||||||
@if [ "$(TEST)" = "./..." ]; then \
|
@if [ "$(TEST)" = "./..." ]; then \
|
||||||
|
@ -26,10 +28,22 @@ updatedeps:
|
||||||
git symbolic-ref --short HEAD 2>/dev/null \
|
git symbolic-ref --short HEAD 2>/dev/null \
|
||||||
|| git rev-parse HEAD"))
|
|| git rev-parse HEAD"))
|
||||||
go get -u golang.org/x/tools/cmd/stringer
|
go get -u golang.org/x/tools/cmd/stringer
|
||||||
|
go get -u golang.org/x/tools/cmd/vet
|
||||||
go get -f -u -v ./...
|
go get -f -u -v ./...
|
||||||
git checkout $(REF)
|
git checkout $(REF)
|
||||||
|
|
||||||
|
vet:
|
||||||
|
@go tool vet 2>/dev/null ; if [ $$? -eq 3 ]; then \
|
||||||
|
go get golang.org/x/tools/cmd/vet; \
|
||||||
|
fi
|
||||||
|
@echo "go tool vet $(VETARGS) ."
|
||||||
|
@go tool vet $(VETARGS) . ; if [ $$? -eq 1 ]; then \
|
||||||
|
echo ""; \
|
||||||
|
echo "Vet found suspicious constructs. Please check the reported constructs"; \
|
||||||
|
echo "and fix them if necessary before submitting the code for reviewal."; \
|
||||||
|
fi
|
||||||
|
|
||||||
generate:
|
generate:
|
||||||
go generate ./...
|
go generate ./...
|
||||||
|
|
||||||
.PHONY: bin default generate test updatedeps
|
.PHONY: bin default generate test updatedeps vet
|
||||||
|
|
Loading…
Reference in New Issue