Skip to content

Commit 52ec83c

Browse files
authored
Update golangci-lint schema to v2 (#555)
1 parent 8bbd11f commit 52ec83c

File tree

2 files changed

+72
-82
lines changed

2 files changed

+72
-82
lines changed

.github/workflows/pre-main.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ jobs:
5858
uses: mfinelli/setup-shfmt@v3
5959

6060
- name: Golangci-lint
61-
uses: golangci/golangci-lint-action@v6
61+
uses: golangci/golangci-lint-action@v7
6262
with:
63-
version: v1.64
6463
args: --timeout 10m0s
6564

6665
- name: Checkmake

.golangci.yml

Lines changed: 71 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,96 @@
1-
linters-settings:
2-
dupl:
3-
threshold: 100
4-
funlen:
5-
lines: 50
6-
statements: 25
7-
goconst:
8-
min-len: 4
9-
min-occurrences: 2
10-
gocritic:
11-
enabled-tags:
12-
- diagnostic
13-
- experimental
14-
- opinionated
15-
- performance
16-
- style
17-
disabled-checks:
18-
- whyNoLint
19-
gocyclo:
20-
min-complexity: 15
21-
govet:
22-
settings:
23-
printf:
24-
funcs:
25-
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
26-
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
27-
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
28-
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
29-
lll:
30-
line-length: 250
31-
nolintlint:
32-
allow-unused: false # report any unused nolint directives
33-
require-explanation: false # do not require an explanation for nolint directives
34-
require-specific: true # require nolint directives to be specific about which linter is being skipped
1+
version: "2"
352
linters:
36-
# please, do not use `enable-all`: it's deprecated and will be removed soon.
37-
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
38-
disable-all: true
3+
default: none
394
enable:
405
- bodyclose
6+
- copyloopvar
417
- dogsled
428
- errcheck
439
- exhaustive
44-
- copyloopvar
4510
- funlen
4611
- goconst
4712
- gocritic
4813
- gocyclo
49-
- gofmt
50-
- goimports
51-
- mnd
5214
- goprintffuncname
5315
- gosec
54-
- gosimple
5516
- govet
5617
- ineffassign
5718
- lll
5819
- misspell
20+
- mnd
5921
- nakedret
6022
- nolintlint
6123
- revive
6224
- rowserrcheck
6325
- staticcheck
64-
- stylecheck
65-
- typecheck
6626
- unconvert
6727
- unparam
6828
- unused
6929
- whitespace
70-
# do not enable:
71-
# - asciicheck
72-
# - depguard
73-
# - dupl
74-
# - gochecknoglobals
75-
# - gochecknoinits
76-
# - gocognit
77-
# - godot
78-
# - godox
79-
# - goerr113
80-
# - maligned
81-
# - nestif
82-
# - noctx
83-
# - prealloc
84-
# - copyloopvar
85-
# - structcheck
86-
# - testpackage
87-
# - wsl
88-
issues:
89-
# Excluding configuration per-path, per-linter, per-text and per-source
90-
exclude-rules:
91-
# Ignore magic numbers, inline strings and function length in tests.
92-
- path: _test\.go
93-
linters:
94-
- mnd
95-
- goconst
96-
- funlen
97-
# Ignore line length for string assignments (do not try and wrap regex definitions)
98-
- linters:
99-
- lll
100-
source: "^(.*= (\".*\"|`.*`))$"
101-
# https://github.com/go-critic/go-critic/issues/926
102-
- linters:
103-
- gocritic
104-
text: "unnecessaryDefer:"
105-
# Ignore static strings in tests
30+
settings:
31+
dupl:
32+
threshold: 100
33+
funlen:
34+
lines: 50
35+
statements: 25
36+
goconst:
37+
min-len: 4
38+
min-occurrences: 2
39+
gocritic:
40+
disabled-checks:
41+
- whyNoLint
42+
enabled-tags:
43+
- diagnostic
44+
- experimental
45+
- opinionated
46+
- performance
47+
- style
48+
gocyclo:
49+
min-complexity: 15
50+
govet:
51+
settings:
52+
printf:
53+
funcs:
54+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
55+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
56+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
57+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
58+
lll:
59+
line-length: 250
60+
nolintlint:
61+
require-explanation: false
62+
require-specific: true
63+
allow-unused: false
64+
exclusions:
65+
generated: lax
66+
presets:
67+
- comments
68+
- common-false-positives
69+
- legacy
70+
- std-error-handling
71+
rules:
72+
- linters:
73+
- funlen
74+
- goconst
75+
- mnd
76+
path: _test\.go
77+
- linters:
78+
- lll
79+
source: ^(.*= (".*"|`.*`))$
80+
- linters:
81+
- gocritic
82+
text: 'unnecessaryDefer:'
83+
paths:
84+
- third_party$
85+
- builtin$
86+
- examples$
87+
formatters:
88+
enable:
89+
- gofmt
90+
- goimports
91+
exclusions:
92+
generated: lax
93+
paths:
94+
- third_party$
95+
- builtin$
96+
- examples$

0 commit comments

Comments
 (0)