diff --git a/.circleci/config.yml b/.circleci/config.yml index 2d7680bb2..6735264d8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,12 +16,9 @@ jobs: - run: name: go vet command: V=1 CI=1 make vet - - run: - name: Install linters - command: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s v1.32.2 && mv ./bin/* /go/bin/ - run: name: Lint - command: golangci-lint run ./... + command: make lint - run: name: Dependencies command: scripts/validate/gomod.sh diff --git a/.golangci.yml b/.golangci.yml index a57e3ba4b..2dd22ffc7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -23,4 +23,4 @@ issues: - Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked # EXC0003 golint: False positive when tests are defined in package 'test' - - func name will be used as test\.Test.* by other packages, and that stutters; consider calling this \ No newline at end of file + - func name will be used as test\.Test.* by other packages, and that stutters; consider calling this diff --git a/Makefile b/Makefile index 2f56be13f..510c53593 100644 --- a/Makefile +++ b/Makefile @@ -192,3 +192,7 @@ envtest: kubebuilder_2.3.1_${TEST_OS}_${TEST_ARCH} .PHONY: fmt fmt: goimports -w $(shell go list -f '{{.Dir}}' ./...) + +.PHONY: lint +lint: $(gobin_tool) + gobin -run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.33.0 run ./...