@@ -3,6 +3,7 @@ OUT_DIR := ./out
33TESTS_DIR := ./tests
44
55GO_FILES := $(shell find . -type f \( -iname '* .go' \) )
6+ GO_MODULE := github.com/pushbits/server
67
78PB_BUILD_VERSION ?= $(shell git describe --tags)
89ifeq ($(PB_BUILD_VERSION ) ,)
@@ -21,17 +22,18 @@ clean:
2122
2223.PHONY : test
2324test :
24- stdout=$$(gofumpt -l . 2>&1 ) ; if [ " $$ stdout" ]; then exit 1; fi
25+ if [ -n " $$ (gofumpt -l $( GO_FILES) )" ]; then echo " Code is not properly formatted" ; exit 1; fi
26+ if [ -n " $$ (goimports -l -local $( GO_MODULE) $( GO_FILES) )" ]; then echo " Imports are not properly formatted" ; exit 1; fi
2527 go vet ./...
2628 misspell -error $(GO_FILES )
2729 gocyclo -over 10 $(GO_FILES )
2830 staticcheck ./...
29- errcheck -exclude errcheck_excludes.txt ./...
31+ errcheck -ignoregenerated - exclude errcheck_excludes.txt ./...
3032 gocritic check -disable=
' #experimental,#opinionated' [email protected] 3 ./...
3133 revive -set_exit_status -exclude ./docs ./...
3234 nilaway ./...
3335 go test -v -cover ./...
34- gosec -exclude-dir=tests ./...
36+ gosec -exclude-generated -exclude- dir=tests ./...
3537 govulncheck ./...
3638 @printf ' \n%s\n' " > Test successful"
3739
4547 go install github.com/securego/gosec/v2/cmd/gosec@latest
4648 go install github.com/swaggo/swag/cmd/swag@latest
4749 go install go.uber.org/nilaway/cmd/nilaway@latest
50+ go install golang.org/x/tools/cmd/goimports@latest
4851 go install golang.org/x/vuln/cmd/govulncheck@latest
4952 go install honnef.co/go/tools/cmd/staticcheck@latest
5053 go install mvdan.cc/gofumpt@latest
0 commit comments