diff --git a/Makefile b/Makefile index 74012544d51..05c15b301f3 100644 --- a/Makefile +++ b/Makefile @@ -263,6 +263,12 @@ gocyclo: # Run gocyclo over all .go files gocyclo -over 15 ${GOFILES} +.PHONY: staticcheck +staticcheck: + # check for unused code using staticcheck binary + # https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck + staticcheck -tests=false -checks "U1000" ./agent/... + # same as gofiles above, but without the `-f` .PHONY: govet govet: @@ -276,7 +282,7 @@ importcheck: @if [ -n "$(DIFFS)" ]; then echo "Files incorrectly formatted. Fix formatting by running goimports:"; echo "$(DIFFS)"; exit 1; fi .PHONY: static-check -static-check: gocyclo govet importcheck +static-check: gocyclo govet importcheck staticcheck .PHONY: goimports goimports: @@ -287,6 +293,7 @@ goimports: go get github.com/golang/mock/mockgen go get golang.org/x/tools/cmd/goimports go get github.com/fzipp/gocyclo + go get honnef.co/go/tools/cmd/staticcheck touch .get-deps-stamp get-deps: .get-deps-stamp