Merge pull request #144 from prometheus-community/superq/update-linting

Update linting
This commit is contained in:
David Randall 2023-08-12 06:14:10 -04:00 committed by GitHub
commit d5173a5b6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 8 deletions

View file

@ -1,3 +1,5 @@
---
# This action is synced from https://github.com/prometheus/prometheus
name: golangci-lint
on:
push:
@ -27,4 +29,4 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v3.4.0
with:
version: v1.51.2
version: v1.53.3

View file

@ -1,4 +1,17 @@
---
linters:
enable:
- misspell
- revive
disable:
# Disable soon to deprecated[1] linters that lead to false
# positives when build tags disable certain files[2]
# 1: https://github.com/golangci/golangci-lint/issues/1841
# 2: https://github.com/prometheus/node_exporter/issues/1545
- deadcode
- unused
- structcheck
- varcheck
issues:
exclude-rules:
- path: _test.go
@ -7,4 +20,14 @@ issues:
linters-settings:
errcheck:
exclude: scripts/errcheck_excludes.txt
exclude-functions:
# Used in HTTP handlers, any error is handled by the server itself.
- (net/http.ResponseWriter).Write
# Never check for logger errors.
- (github.com/go-kit/log.Logger).Log
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
- name: unused-parameter
severity: warning
disabled: true

View file

@ -55,7 +55,7 @@ ifneq ($(shell command -v gotestsum > /dev/null),)
endif
endif
PROMU_VERSION ?= 0.14.0
PROMU_VERSION ?= 0.15.0
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
SKIP_GOLANGCI_LINT :=

View file

@ -1,4 +0,0 @@
// Used in HTTP handlers, any error is handled by the server itself.
(net/http.ResponseWriter).Write
// Never check for logger errors.
(github.com/go-kit/log.Logger).Log