Skip to content

Commit 448359f

Browse files
authored
Update golangci-lint to v2.7.2 and migrate configuration (#7386)
1 parent bb9da2e commit 448359f

68 files changed

Lines changed: 780 additions & 751 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,4 @@ govulncheck-results.sarif
127127
trivy-results.sarif
128128

129129
# License compliance reports
130-
licenses.csv
130+
licenses.csv*.bck.yml

.golangci.yml

Lines changed: 56 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,62 @@
1+
version: "2"
12
run:
2-
timeout: 5m
33
tests: true
4-
54
linters:
65
enable:
7-
- errcheck
6+
- misspell
7+
- revive
8+
settings:
9+
errcheck:
10+
exclude-functions:
11+
- (*os.File).Close
12+
- (*os.File).Sync
13+
- os.Chdir
14+
- os.Chmod
15+
- os.Chtimes
16+
- os.MkdirAll
17+
- os.Remove
18+
- os.RemoveAll
19+
- os.WriteFile
20+
exclusions:
21+
generated: lax
22+
presets:
23+
- comments
24+
- common-false-positives
25+
- legacy
26+
- std-error-handling
27+
rules:
28+
- linters:
29+
- errcheck
30+
path: _test\.go
31+
- linters:
32+
- revive
33+
text: unused-parameter
34+
- linters:
35+
- revive
36+
text: var-naming
37+
- linters:
38+
- revive
39+
text: redefines-builtin-id
40+
- linters:
41+
- revive
42+
text: indent-error-flow
43+
- linters:
44+
- revive
45+
text: superfluous-else
46+
- linters:
47+
- revive
48+
text: exported
49+
paths:
50+
- third_party$
51+
- builtin$
52+
- examples$
53+
formatters:
54+
enable:
855
- gofmt
956
- goimports
10-
- revive
11-
- govet
12-
- ineffassign
13-
- misspell
14-
- staticcheck
15-
- typecheck
16-
- unused
17-
18-
linters-settings:
19-
errcheck:
20-
# Disable errcheck for test files - system calls in tests don't need error handling
21-
exclude-functions:
22-
- (*os.File).Close
23-
- (*os.File).Sync
24-
- os.Chdir
25-
- os.Chmod
26-
- os.Chtimes
27-
- os.MkdirAll
28-
- os.Remove
29-
- os.RemoveAll
30-
- os.WriteFile
31-
32-
issues:
33-
exclude-rules:
34-
# Disable errcheck for all test files
35-
- path: "_test\\.go"
36-
linters:
37-
- errcheck
38-
39-
# Disable noisy revive rules repository-wide
40-
- linters:
41-
- revive
42-
text: "unused-parameter"
43-
- linters:
44-
- revive
45-
text: "var-naming"
46-
- linters:
47-
- revive
48-
text: "redefines-builtin-id"
49-
- linters:
50-
- revive
51-
text: "indent-error-flow"
52-
- linters:
53-
- revive
54-
text: "superfluous-else"
55-
- linters:
56-
- revive
57-
text: "exported"
58-
59-
57+
exclusions:
58+
generated: lax
59+
paths:
60+
- third_party$
61+
- builtin$
62+
- examples$

0 commit comments

Comments
 (0)