From 0c3038d4b5479e475217f2990107f376024d5726 Mon Sep 17 00:00:00 2001 From: baude Date: Mon, 22 Jul 2019 13:08:06 -0500 Subject: golangci-lint phase 4 clean up some final linter issues and add a make target for golangci-lint. in addition, begin running the tests are part of the gating tasks in cirrus ci. we cannot fully shift over to the new linter until we fix the image on the openshift side. for short term, we will use both Signed-off-by: baude --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e155d31d4..2ebcb6605 100644 --- a/Makefile +++ b/Makefile @@ -136,6 +136,9 @@ lint: .gopathok varlink_generate ## Execute the source code linter @echo "checking lint" @./.tool/lint +golangci-lint: .gopathok varlink_generate .install.golangci-lint + $(GOBIN)/golangci-lint run --tests=false + gofmt: ## Verify the source code gofmt find . -name '*.go' ! -path './vendor/*' -exec gofmt -s -w {} \+ git diff --exit-code @@ -360,7 +363,7 @@ uninstall: GIT_CHECK_EXCLUDE="./vendor" $(GOBIN)/git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..$(HEAD) .PHONY: install.tools -install.tools: .install.gitvalidation .install.gometalinter .install.md2man .install.ginkgo ## Install needed tools +install.tools: .install.gitvalidation .install.gometalinter .install.md2man .install.ginkgo .install.golangci-lint ## Install needed tools define go-get env GO111MODULE=off \ @@ -386,6 +389,11 @@ endef $(GOBIN)/gometalinter --install; \ fi +.install.golangci-lint: .gopathok + if [ ! -x "$(GOBIN)/golangci-lint" ]; then \ + curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOBIN)/ v1.17.1; \ + fi + .install.md2man: .gopathok if [ ! -x "$(GOBIN)/go-md2man" ]; then \ $(call go-get,github.com/cpuguy83/go-md2man); \ @@ -444,6 +452,7 @@ vendor: gofmt \ help \ install \ + golangci-lint \ lint \ pause \ uninstall \ -- cgit v1.2.3-54-g00ecf