Skip to content

Commit 2fa81a6

Browse files
prombotjaimeyh
authored andcommitted
Update common Prometheus files (prometheus-community#873)
Signed-off-by: prombot <[email protected]>
1 parent 20267ea commit 2fa81a6

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ jobs:
3333
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
3434
if: github.repository == 'prometheus/snmp_exporter'
3535
- name: Lint
36-
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
36+
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
3737
with:
3838
version: v1.55.2

Makefile.common

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,16 @@ common-vet:
169169
common-lint: $(GOLANGCI_LINT)
170170
ifdef 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)
176173
endif
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
179183
common-yamllint:
180184
@echo ">> running yamllint on all YAML files in the repository"
@@ -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)
208216
common-docker: $(BUILD_DOCKER_ARCHS)
209217
$(BUILD_DOCKER_ARCHS): common-docker-%:

0 commit comments

Comments
 (0)