Skip to content

Commit 3599c6f

Browse files
Merge branch 'master' into testinfraupdate
2 parents fb88e98 + 35d22eb commit 3599c6f

6 files changed

Lines changed: 85 additions & 73 deletions

File tree

.github/workflows/golangci-lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ jobs:
2626
- name: Checkout repository
2727
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2828
- name: Install Go
29-
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
29+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
3030
with:
31-
go-version: 1.23.x
31+
go-version: 1.24.x
3232
- name: Install snmp_exporter/generator dependencies
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@ec5d18412c0aeab7936cb16880d708ba2a64e1ae # v6.2.0
36+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
3737
with:
3838
args: --verbose
39-
version: v1.63.4
39+
version: v2.0.2

.golangci.yml

Lines changed: 77 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,89 @@
1+
formatters:
2+
enable:
3+
- gofumpt
4+
- goimports
5+
settings:
6+
goimports:
7+
local-prefixes:
8+
- github.com/prometheus/test-infra
19
issues:
2-
exclude-files:
3-
# Skip autogenerated files.
4-
- ^.*\.(pb|y)\.go$
510
max-issues-per-linter: 0
611
max-same-issues: 0
7-
812
linters:
913
enable:
1014
- errorlint
11-
- gofumpt
12-
- goimports
1315
- gomodguard
1416
- misspell
1517
- revive
1618
- whitespace
17-
18-
linters-settings:
19-
goimports:
20-
local-prefixes: github.com/prometheus/test-infra
21-
gomodguard:
22-
blocked:
23-
modules:
24-
- github.com/pkg/errors:
25-
recommendations:
26-
- errors
27-
- fmt
28-
revive:
29-
rules:
30-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
31-
- name: blank-imports
32-
disabled: true
33-
- name: comment-spacings
34-
- name: context-as-argument
35-
arguments:
36-
# Allow functions with test or bench signatures.
37-
- allowTypesBefore: "*testing.T,testing.TB"
38-
- name: context-keys-type
39-
- name: dot-imports
40-
- name: early-return
41-
arguments:
42-
- "preserveScope"
43-
# A lot of false positives: incorrectly identifies channel draining as "empty code block".
44-
# See https://github.com/mgechev/revive/issues/386
45-
- name: empty-block
46-
disabled: true
47-
- name: error-naming
48-
- name: error-return
49-
- name: error-strings
50-
- name: errorf
51-
- name: exported
52-
- name: increment-decrement
53-
- name: indent-error-flow
54-
arguments:
55-
- "preserveScope"
56-
- name: package-comments
57-
# TODO(beorn7): Currently, we have a lot of missing package doc comments. Maybe we should have them.
58-
disabled: true
59-
- name: range
60-
- name: receiver-naming
61-
- name: redefines-builtin-id
62-
- name: superfluous-else
63-
arguments:
64-
- "preserveScope"
65-
- name: time-naming
66-
- name: unexported-return
67-
- name: unreachable-code
68-
- name: unused-parameter
69-
- name: var-declaration
70-
- name: var-naming
71-
disabled: true
72-
73-
output:
74-
sort-results: true
75-
19+
exclusions:
20+
generated: strict
21+
paths:
22+
# Skip autogenerated files.
23+
- ^.*\.(pb|y)\.go$
24+
presets:
25+
- comments
26+
- common-false-positives
27+
- legacy
28+
- std-error-handling
29+
warn-unused: true
30+
settings:
31+
gomodguard:
32+
blocked:
33+
modules:
34+
- github.com/pkg/errors:
35+
recommendations:
36+
- errors
37+
- fmt
38+
revive:
39+
rules:
40+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
41+
- name: blank-imports
42+
disabled: true
43+
- name: comment-spacings
44+
- name: context-as-argument
45+
arguments:
46+
# Allow functions with test or bench signatures.
47+
- allowTypesBefore: '*testing.T,testing.TB'
48+
- name: context-keys-type
49+
- name: dot-imports
50+
- name: early-return
51+
arguments:
52+
- preserveScope
53+
# A lot of false positives: incorrectly identifies channel draining as "empty code block".
54+
# See https://github.com/mgechev/revive/issues/386
55+
- name: empty-block
56+
disabled: true
57+
- name: error-naming
58+
- name: error-return
59+
- name: error-strings
60+
- name: errorf
61+
- name: exported
62+
- name: increment-decrement
63+
- name: indent-error-flow
64+
arguments:
65+
- preserveScope
66+
- name: package-comments
67+
# TODO(beorn7): Currently, we have a lot of missing package doc comments. Maybe we should have them.
68+
disabled: true
69+
- name: range
70+
- name: receiver-naming
71+
- name: redefines-builtin-id
72+
- name: superfluous-else
73+
arguments:
74+
- preserveScope
75+
- name: time-naming
76+
- name: unexported-return
77+
- name: unreachable-code
78+
- name: unused-parameter
79+
- name: var-declaration
80+
- name: var-naming
81+
disabled: true
82+
staticcheck:
83+
checks:
84+
- all
85+
- -ST1003 # FIXME: Poorly chosen identifier
86+
- -ST1005 # FIXME: Incorrectly formatted error string
7687
run:
7788
timeout: 5m
89+
version: "2"

Makefile.common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
6161
SKIP_GOLANGCI_LINT :=
6262
GOLANGCI_LINT :=
6363
GOLANGCI_LINT_OPTS ?=
64-
GOLANGCI_LINT_VERSION ?= v1.63.4
64+
GOLANGCI_LINT_VERSION ?= v2.0.2
6565
# 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.
6767
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))

pkg/provider/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func applyTemplateVars(content []byte, deploymentVars map[string]string) ([]byte
8484
t = t.Funcs(template.FuncMap{
8585
// k8s objects can't have dots(.) se we add a custom function to allow normalising the variable values.
8686
"normalise": func(t string) string {
87-
return strings.Replace(t, ".", "-", -1)
87+
return strings.ReplaceAll(t, ".", "-")
8888
},
8989
"split": func(rangeVars, separator string) []string {
9090
return strings.Split(rangeVars, separator)

prombench/manifests/cert-manager/1b_certificate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
namespace: default
66
spec:
77
dnsNames:
8-
- prombench.prometheus.io
8+
- prombench.prometheus.io
99
secretName: prombench-prometheus-tls
1010
issuerRef:
1111
name: letsencrypt-cluster-issuer

prombench/manifests/cluster-infra/3b_prometheus-meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ spec:
266266
ingressClassName: nginx
267267
tls:
268268
- hosts:
269-
- prombench.prometheus.io
269+
- prombench.prometheus.io
270270
secretName: prombench-prometheus-tls
271271
rules:
272272
- http:

0 commit comments

Comments
 (0)