From dac969b14ee02a6fb535cb5aee898764b81af15b Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 8 Apr 2022 22:55:48 -0400 Subject: [PATCH] Makefile: staticcheck validation Signed-off-by: Vincent Batts --- .gitignore | 2 ++ Makefile | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1ddf2a6..1b78688 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ .lint .test .vet +.staticcheck +.gocyclo gomtree diff --git a/Makefile b/Makefile index ec9b37d..0eb08af 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ default: build validation validation: .test .lint .vet .cli.test .PHONY: validation.tags -validation.tags: .test.tags .vet.tags .cli.test +validation.tags: .test.tags .vet.tags .cli.test .staticcheck .PHONY: gocyclo gocyclo: .gocyclo @@ -24,6 +24,14 @@ CLEAN_FILES += .gocyclo .gocyclo: gocyclo -avg -over 15 -ignore 'vendor/*' . && touch $@ +.PHONY: staticcheck +staticcheck: .staticcheck + +CLEAN_FILES += .staticcheck + +.staticcheck: + staticcheck . && touch $@ + .PHONY: test test: .test @@ -79,6 +87,7 @@ $(BUILD): $(SOURCE_FILES) install.tools: @go install -u github.com/fatih/color@latest ; \ go install -u github.com/fzipp/gocyclo/cmd/gocyclo@latest ; \ + go install -u honnef.co/go/tools/cmd/staticcheck@latest ; \ if [ "$(findstring $(GO_VER),$(shell go version))" != "" ] ; then \ go get -u golang.org/x/lint/golint ;\ fi