@@ -49,23 +49,23 @@ endif
4949GOTEST := $(GO) test
5050GOTEST_DIR :=
5151ifneq ($(CIRCLE_JOB),)
52- ifneq ($(shell command -v gotestsum > /dev/null),)
52+ ifneq ($(shell command -v gotestsum 2 > /dev/null),)
5353 GOTEST_DIR := test-results
5454 GOTEST := gotestsum --junitfile $(GOTEST_DIR)/unit-tests.xml --
5555endif
5656endif
5757
58- PROMU_VERSION ?= 0.15 .0
58+ PROMU_VERSION ?= 0.17 .0
5959PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
6060
6161SKIP_GOLANGCI_LINT :=
6262GOLANGCI_LINT :=
6363GOLANGCI_LINT_OPTS ?=
64- GOLANGCI_LINT_VERSION ?= v1.55 .2
65- # golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
64+ GOLANGCI_LINT_VERSION ?= v1.60 .2
65+ # golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64 .
6666# windows isn't included here because of the path separator being different.
6767ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
68- ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386))
68+ ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386 arm64 ))
6969 # If we're in CI and there is an Actions file, that means the linter
7070 # is being run in Actions, so we don't need to run it here.
7171 ifneq (,$(SKIP_GOLANGCI_LINT))
@@ -169,16 +169,20 @@ common-vet:
169169common-lint: $(GOLANGCI_LINT)
170170ifdef GOLANGCI_LINT
171171 @echo ">> running golangci-lint"
172- # 'go list' needs to be executed before staticcheck to prepopulate the modules cache.
173- # Otherwise staticcheck might fail randomly for some reason not yet explained.
174- $(GO) list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null
175172 $(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs)
176173endif
177174
175+ .PHONY: common-lint-fix
176+ common-lint-fix: $(GOLANGCI_LINT)
177+ ifdef GOLANGCI_LINT
178+ @echo ">> running golangci-lint fix"
179+ $(GOLANGCI_LINT) run --fix $(GOLANGCI_LINT_OPTS) $(pkgs)
180+ endif
181+
178182.PHONY: common-yamllint
179183common-yamllint:
180184 @echo ">> running yamllint on all YAML files in the repository"
181- ifeq (, $(shell command -v yamllint > /dev/null))
185+ ifeq (, $(shell command -v yamllint 2 > /dev/null))
182186 @echo "yamllint not installed so skipping"
183187else
184188 yamllint .
@@ -204,6 +208,10 @@ common-tarball: promu
204208 @echo ">> building release tarball"
205209 $(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR)
206210
211+ .PHONY: common-docker-repo-name
212+ common-docker-repo-name:
213+ @echo "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)"
214+
207215.PHONY: common-docker $(BUILD_DOCKER_ARCHS)
208216common-docker: $(BUILD_DOCKER_ARCHS)
209217$(BUILD_DOCKER_ARCHS): common-docker-%:
@@ -267,3 +275,9 @@ $(1)_precheck:
267275 exit 1; \
268276 fi
269277endef
278+
279+ govulncheck: install-govulncheck
280+ govulncheck ./...
281+
282+ install-govulncheck:
283+ command -v govulncheck > /dev/null || go install golang.org/x/vuln/cmd/govulncheck@latest
0 commit comments