@@ -78,17 +78,23 @@ ifneq ($(shell which gotestsum),)
78
78
endif
79
79
endif
80
80
81
- PROMU_VERSION ?= 0.12 .0
81
+ PROMU_VERSION ?= 0.13 .0
82
82
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
83
83
84
84
GOLANGCI_LINT :=
85
85
GOLANGCI_LINT_OPTS ?=
86
- GOLANGCI_LINT_VERSION ?= v1.39 .0
86
+ GOLANGCI_LINT_VERSION ?= v1.42 .0
87
87
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
88
88
# windows isn't included here because of the path separator being different.
89
89
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
90
90
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
92
98
endif
93
99
endif
94
100
@@ -118,7 +124,7 @@ endif
118
124
%: common-% ;
119
125
120
126
.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
122
128
123
129
.PHONY: common-style
124
130
common-style:
@@ -154,7 +160,7 @@ endif
154
160
update-go-deps:
155
161
@echo ">> updating Go dependencies"
156
162
@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; \
158
164
done
159
165
GO111MODULE=$(GO111MODULE) $(GO) mod tidy
160
166
ifneq (,$(wildcard vendor))
@@ -198,6 +204,15 @@ else
198
204
endif
199
205
endif
200
206
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
+
201
216
# For backward-compatibility.
202
217
.PHONY: common-staticcheck
203
218
common-staticcheck: lint
0 commit comments