From 8b76fe64a210aa70830cbdadae4132e12973c795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lionel=20F=C3=A9licit=C3=A9?= Date: Wed, 21 Oct 2020 23:11:06 +0200 Subject: [PATCH] add gocyclo's step ref #23 --- .github/workflows/on_push.yml | 3 +++ Makefile | 11 ++++++++--- README.md | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml index bae1a97..982de1d 100644 --- a/.github/workflows/on_push.yml +++ b/.github/workflows/on_push.yml @@ -27,6 +27,8 @@ jobs: which gox go get golang.org/x/lint/golint which golint + go get github.com/fzipp/gocyclo/cmd/gocyclo + which gocyclo cd $GITHUB_WORKSPACE/$checkout_dir make ci_windows - name: Archive artifacts @@ -55,6 +57,7 @@ jobs: go get github.com/securego/gosec/cmd/gosec go get github.com/mitchellh/gox go get golang.org/x/lint/golint + go get github.com/fzipp/gocyclo/cmd/gocyclo cd $GITHUB_WORKSPACE/$checkout_dir make ci - name: Build BSD artefacts diff --git a/Makefile b/Makefile index 439f630..5ec701c 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ OUTPUT="./output" SRC=$(shell find . -name "*.go") .PHONY: all clean ci build build_vanilla build_bsd test check_fmt fmt vet security security_w -.PHONY: lint quality +.PHONY: lint quality gocyclo all: clean install_deps quality security test build @@ -30,11 +30,16 @@ security_w: @echo "[OK] Go security check is done!" lint: - $(info ***************** Lint ***********************************) + $(info ***************** Lint ***************************************) golint -set_exit_status ./... @echo "[OK] Go linting is done!" -quality: check_fmt vet lint +gocyclo: + $(info ***************** gocyclo ************************************) + gocyclo -total-short -over 10 . + @echo "[OK] gocyclo is done!" + +quality: check_fmt vet lint gocyclo build: output make -f build.make all diff --git a/README.md b/README.md index c869362..8873c7a 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ jntpdn --port 80 --file /where/my/file/is ### Development & build's dependancies +* [gocyclo](https://github.com/fzipp/gocyclo) * [golint](https://github.com/golang/lint) * [goreleaser](https://github.com/goreleaser/goreleaser) * [gosec](https://github.com/securego/gosec)