From 599ae1553725a3cb05ea693dd508813da06b9ba8 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 8 Apr 2022 22:08:50 -0400 Subject: [PATCH] Makefile: check cyclomatic complexity Signed-off-by: Vincent Batts --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f5017ed..ec9b37d 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,14 @@ validation: .test .lint .vet .cli.test .PHONY: validation.tags validation.tags: .test.tags .vet.tags .cli.test +.PHONY: gocyclo +gocyclo: .gocyclo + +CLEAN_FILES += .gocyclo + +.gocyclo: + gocyclo -avg -over 15 -ignore 'vendor/*' . && touch $@ + .PHONY: test test: .test @@ -69,7 +77,8 @@ $(BUILD): $(SOURCE_FILES) go build -mod=vendor -o $(BUILD) $(BUILDPATH) install.tools: - @go get -u github.com/fatih/color ; \ + @go install -u github.com/fatih/color@latest ; \ + go install -u github.com/fzipp/gocyclo/cmd/gocyclo@latest ; \ if [ "$(findstring $(GO_VER),$(shell go version))" != "" ] ; then \ go get -u golang.org/x/lint/golint ;\ fi