@@ -78,17 +78,23 @@ ifneq ($(shell which gotestsum),)
7878endif
7979endif
8080
81- PROMU_VERSION ?= 0.12 .0
81+ PROMU_VERSION ?= 0.13 .0
8282PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
8383
8484GOLANGCI_LINT :=
8585GOLANGCI_LINT_OPTS ?=
86- GOLANGCI_LINT_VERSION ?= v1.39 .0
86+ GOLANGCI_LINT_VERSION ?= v1.42 .0
8787# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
8888# windows isn't included here because of the path separator being different.
8989ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
9090 ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386))
91- GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
91+ # If we're in CI and there is an Actions file, that means the linter
92+ # is being run in Actions, so we don't need to run it here.
93+ ifeq (,$(CIRCLE_JOB))
94+ GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
95+ else ifeq (,$(wildcard .github/workflows/golangci-lint.yml))
96+ GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
97+ endif
9298 endif
9399endif
94100
@@ -118,7 +124,7 @@ endif
118124%: common-% ;
119125
120126.PHONY: common-all
121- common-all: precheck style check_license lint unused build test
127+ common-all: precheck style check_license lint yamllint unused build test
122128
123129.PHONY: common-style
124130common-style:
@@ -154,7 +160,7 @@ endif
154160update-go-deps:
155161 @echo ">> updating Go dependencies"
156162 @for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \
157- $(GO) get $$m; \
163+ $(GO) get -d $$m; \
158164 done
159165 GO111MODULE=$(GO111MODULE) $(GO) mod tidy
160166ifneq (,$(wildcard vendor))
@@ -198,6 +204,15 @@ else
198204endif
199205endif
200206
207+ .PHONY: common-yamllint
208+ common-yamllint:
209+ @echo ">> running yamllint on all YAML files in the repository"
210+ ifeq (, $(shell which yamllint))
211+ @echo "yamllint not installed so skipping"
212+ else
213+ yamllint .
214+ endif
215+
201216# For backward-compatibility.
202217.PHONY: common-staticcheck
203218common-staticcheck: lint
0 commit comments