Skip to content

Commit a4d4c6c

Browse files
authored
chore(ci): migrate golangci lint config to v2 (#40)
1 parent c95db0d commit a4d4c6c

File tree

1 file changed

+156
-165
lines changed

1 file changed

+156
-165
lines changed

.golangci.yml

+156-165
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,4 @@
1-
run:
2-
timeout: 10m
3-
4-
output:
5-
sort-results: true
6-
show-stats: true
7-
8-
linters-settings:
9-
cyclop:
10-
max-complexity: 15
11-
package-average: 10
12-
skip-tests: true
13-
dupl:
14-
threshold: 120
15-
errcheck:
16-
exclude-functions:
17-
- encoding/json.Marshal
18-
- encoding/json.MarshalIndent
19-
errchkjson:
20-
check-error-free-encoding: true
21-
report-no-exported: true
22-
exhaustive:
23-
check:
24-
- switch
25-
- map
26-
default-signifies-exhaustive: true
27-
funlen:
28-
lines: 100
29-
statements: 80
30-
gci:
31-
sections:
32-
- standard
33-
- default
34-
- prefix(github.com/redis/go-redis)
35-
- localmodule
36-
custom-order: true
37-
gocognit:
38-
min-complexity: 20
39-
gocritic:
40-
enabled-tags:
41-
- diagnostic
42-
- style
43-
- performance
44-
- experimental
45-
- opinionated
46-
disabled-checks:
47-
- dupImport # https://github.com/go-critic/go-critic/issues/845
48-
- emptyStringTest
49-
- hugeParam
50-
- ifElseChain
51-
- ruleguard
52-
- sloppyReassign
53-
- whyNoLint # nolintlint is better
54-
settings:
55-
captLocal:
56-
paramsOnly: false
57-
unnamedResult:
58-
checkExported: true
59-
gofmt:
60-
simplify: false # covered by gofumpt
61-
rewrite-rules:
62-
- pattern: "interface{}"
63-
replacement: "any"
64-
- pattern: "a[b:len(a)]"
65-
replacement: "a[b:]"
66-
govet:
67-
enable-all: true
68-
disable:
69-
- fieldalignment
70-
grouper:
71-
import-require-single-import: true
72-
mnd:
73-
checks:
74-
- argument
75-
- case
76-
- condition
77-
- return
78-
ignored-numbers:
79-
- "2"
80-
- "10"
81-
- "64"
82-
ignored-functions:
83-
- strings.SplitN
84-
nakedret:
85-
max-func-lines: 50
86-
nolintlint:
87-
allow-unused: false
88-
require-explanation: true
89-
require-specific: true
90-
revive:
91-
rules:
92-
- name: argument-limit
93-
arguments:
94-
- 8
95-
- name: atomic
96-
- name: bool-literal-in-expr
97-
- name: confusing-results
98-
- name: constant-logical-expr
99-
- name: context-as-argument
100-
- name: context-keys-type
101-
- name: datarace
102-
- name: defer
103-
- name: error-naming
104-
- name: error-return
105-
arguments:
106-
- "preserveScope"
107-
- name: errorf
108-
- name: increment-decrement
109-
- name: indent-error-flow
110-
- name: modifies-value-receiver
111-
- name: optimize-operands-order
112-
- name: redundant-import-alias
113-
- name: string-of-int
114-
- name: struct-tag
115-
- name: superfluous-else
116-
- name: time-equal
117-
- name: time-naming
118-
- name: var-naming
119-
stylecheck:
120-
checks:
121-
- "all"
122-
- "-ST1000"
123-
usestdlibvars:
124-
http-method: true
125-
http-status-code: true
126-
time-weekday: true
127-
time-month: true
128-
time-layout: true
129-
crypto-hash: true
130-
default-rpc-path: true
131-
sql-isolation-level: true
132-
tls-signature-scheme: true
133-
constant-kind: true
134-
varnamelen:
135-
max-distance: 10
136-
1+
version: "2"
1372
linters:
1383
enable:
1394
- asasalint
@@ -145,7 +10,6 @@ linters:
14510
- dupl
14611
- dupword
14712
- durationcheck
148-
- errcheck
14913
- errchkjson
15014
- errname
15115
- errorlint
@@ -154,20 +18,14 @@ linters:
15418
- forbidigo
15519
- forcetypeassert
15620
- funlen
157-
- gci
15821
- gocheckcompilerdirectives
15922
- gochecksumtype
16023
- goconst
16124
- gocritic
162-
- gofmt
163-
- gofumpt
16425
- gomoddirectives
16526
- gosec
166-
- gosimple
167-
- govet
16827
- grouper
16928
- inamedparam
170-
- ineffassign
17129
- interfacebloat
17230
- lll
17331
- maintidx
@@ -190,39 +48,172 @@ linters:
19048
- revive
19149
- spancheck
19250
- staticcheck
193-
- stylecheck
19451
- tagalign
19552
- testifylint
19653
- thelper
19754
- tparallel
198-
- typecheck
19955
- unconvert
20056
- unparam
201-
- unused
20257
- usestdlibvars
20358
- usetesting
20459
- varnamelen
20560
- wastedassign
20661
- whitespace
207-
62+
settings:
63+
cyclop:
64+
max-complexity: 15
65+
package-average: 10
66+
dupl:
67+
threshold: 120
68+
errcheck:
69+
exclude-functions:
70+
- encoding/json.Marshal
71+
- encoding/json.MarshalIndent
72+
errchkjson:
73+
check-error-free-encoding: true
74+
report-no-exported: true
75+
exhaustive:
76+
check:
77+
- switch
78+
- map
79+
default-signifies-exhaustive: true
80+
funlen:
81+
lines: 100
82+
statements: 80
83+
gocognit:
84+
min-complexity: 20
85+
gocritic:
86+
disabled-checks:
87+
- dupImport # https://github.com/go-critic/go-critic/issues/845
88+
- emptyStringTest
89+
- hugeParam
90+
- ifElseChain
91+
- ruleguard
92+
- sloppyReassign
93+
- whyNoLint # nolintlint is better
94+
enabled-tags:
95+
- diagnostic
96+
- style
97+
- performance
98+
- experimental
99+
- opinionated
100+
settings:
101+
captLocal:
102+
paramsOnly: false
103+
unnamedResult:
104+
checkExported: true
105+
govet:
106+
disable:
107+
- fieldalignment
108+
enable-all: true
109+
grouper:
110+
import-require-single-import: true
111+
mnd:
112+
checks:
113+
- argument
114+
- case
115+
- condition
116+
- return
117+
ignored-numbers:
118+
- "2"
119+
- "10"
120+
- "64"
121+
ignored-functions:
122+
- strings.SplitN
123+
nakedret:
124+
max-func-lines: 50
125+
nolintlint:
126+
require-explanation: true
127+
require-specific: true
128+
allow-unused: false
129+
revive:
130+
rules:
131+
- name: argument-limit
132+
arguments:
133+
- 8
134+
- name: atomic
135+
- name: bool-literal-in-expr
136+
- name: confusing-results
137+
- name: constant-logical-expr
138+
- name: context-as-argument
139+
- name: context-keys-type
140+
- name: datarace
141+
- name: defer
142+
- name: error-naming
143+
- name: error-return
144+
arguments:
145+
- preserveScope
146+
- name: errorf
147+
- name: filename-format
148+
- name: increment-decrement
149+
- name: indent-error-flow
150+
- name: modifies-value-receiver
151+
- name: optimize-operands-order
152+
- name: redundant-import-alias
153+
- name: string-of-int
154+
- name: struct-tag
155+
- name: superfluous-else
156+
- name: time-equal
157+
- name: time-naming
158+
- name: var-naming
159+
staticcheck:
160+
checks:
161+
- -ST1000
162+
- all
163+
usestdlibvars:
164+
http-method: true
165+
http-status-code: true
166+
time-weekday: true
167+
time-month: true
168+
time-layout: true
169+
crypto-hash: true
170+
default-rpc-path: true
171+
sql-isolation-level: true
172+
tls-signature-scheme: true
173+
constant-kind: true
174+
varnamelen:
175+
max-distance: 10
176+
exclusions:
177+
generated: lax
178+
presets:
179+
- comments
180+
- std-error-handling
181+
rules:
182+
- linters:
183+
- containedctx
184+
- cyclop
185+
- dupl
186+
- exhaustive
187+
- exhaustruct
188+
- forcetypeassert
189+
- funlen
190+
- mnd
191+
- nakedret
192+
- spancheck
193+
- varnamelen
194+
path: _test\.go
208195
issues:
209-
include:
210-
- EXC0003
211-
- EXC0004
212-
- EXC0005
213-
- EXC0006
214-
exclude-rules:
215-
- path: _test\.go
216-
linters:
217-
- containedctx
218-
- dupl
219-
- exhaustive
220-
- exhaustruct
221-
- forcetypeassert
222-
- funlen
223-
- mnd
224-
- nakedret
225-
- spancheck
226-
- varnamelen
227196
max-issues-per-linter: 0
228197
max-same-issues: 0
198+
formatters:
199+
enable:
200+
- gci
201+
- gofmt
202+
- gofumpt
203+
settings:
204+
gci:
205+
sections:
206+
- standard
207+
- default
208+
- prefix(github.com/redis/go-redis)
209+
- localmodule
210+
custom-order: true
211+
gofmt:
212+
simplify: false # covered by gofumpt
213+
rewrite-rules:
214+
- pattern: interface{}
215+
replacement: any
216+
- pattern: a[b:len(a)]
217+
replacement: a[b:]
218+
exclusions:
219+
generated: lax

0 commit comments

Comments
 (0)