Skip to content

Commit 199d5ea

Browse files
authored
chore: enable context-as-argument from revive
1 parent 0c62fd1 commit 199d5ea

File tree

1 file changed

+14
-88
lines changed

1 file changed

+14
-88
lines changed

.golangci.yml

Lines changed: 14 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -175,148 +175,74 @@ linters-settings:
175175
# This means that linting errors with less than 0.8 confidence will be ignored.
176176
# Default: 0.8
177177
confidence: 0.01
178+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
178179
rules:
179-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#blank-imports
180180
- name: blank-imports
181-
disabled: false
182-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr
183181
- name: bool-literal-in-expr
184-
disabled: false
185-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#constant-logical-expr
186182
- name: constant-logical-expr
187-
disabled: false
188-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-as-argument
189-
# TODO (#3372) re-enable linter when it is compatible. https://github.com/golangci/golangci-lint/issues/3280
190183
- name: context-as-argument
191-
disabled: true
192184
arguments:
193-
allowTypesBefore: "*testing.T"
194-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-keys-type
185+
- allowTypesBefore: "*testing.T"
195186
- name: context-keys-type
196-
disabled: false
197-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#deep-exit
198187
- name: deep-exit
199-
disabled: false
200-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#defer
201188
- name: defer
202-
disabled: false
203189
arguments:
204190
- ["call-chain", "loop"]
205-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports
206191
- name: dot-imports
207-
disabled: false
208-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#duplicated-imports
209192
- name: duplicated-imports
210-
disabled: false
211-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return
212193
- name: early-return
213-
disabled: false
214-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-block
194+
arguments:
195+
- "preserveScope"
215196
- name: empty-block
216-
disabled: false
217-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines
218197
- name: empty-lines
219-
disabled: false
220-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-naming
221198
- name: error-naming
222-
disabled: false
223-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-return
224199
- name: error-return
225-
disabled: false
226-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#error-strings
227200
- name: error-strings
228-
disabled: false
229-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#errorf
230201
- name: errorf
231-
disabled: false
232-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported
233202
- name: exported
234-
disabled: false
235203
arguments:
236204
- "sayRepetitiveInsteadOfStutters"
237-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#flag-parameter
238205
- name: flag-parameter
239-
disabled: false
240-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#identical-branches
241206
- name: identical-branches
242-
disabled: false
243-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return
244207
- name: if-return
245-
disabled: false
246-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#increment-decrement
208+
- name: import-shadowing
247209
- name: increment-decrement
248-
disabled: false
249-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#indent-error-flow
250210
- name: indent-error-flow
251-
disabled: false
252-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-shadowing
253-
- name: import-shadowing
254-
disabled: false
255-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#package-comments
211+
arguments:
212+
- "preserveScope"
256213
- name: package-comments
257-
disabled: false
258-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range
259214
- name: range
260-
disabled: false
261-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-in-closure
262215
- name: range-val-in-closure
263-
disabled: false
264-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#range-val-address
265216
- name: range-val-address
266-
disabled: false
267-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redefines-builtin-id
268217
- name: redefines-builtin-id
269-
disabled: false
270-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-format
271218
- name: string-format
272-
disabled: false
273219
arguments:
274220
- - panic
275221
- '/^[^\n]*$/'
276222
- must not contain line breaks
277-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag
278223
- name: struct-tag
279-
disabled: false
280-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#superfluous-else
281224
- name: superfluous-else
282-
disabled: false
283-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#time-equal
284-
- name: time-equal
285-
disabled: false
286-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-naming
287-
- name: var-naming
288-
disabled: false
289225
arguments:
290-
- ["ID"] # AllowList
291-
- ["Otel", "Aws", "Gcp"] # DenyList
292-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-declaration
293-
- name: var-declaration
294-
disabled: false
295-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unconditional-recursion
226+
- "preserveScope"
227+
- name: time-equal
296228
- name: unconditional-recursion
297-
disabled: false
298-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return
299229
- name: unexported-return
300-
disabled: false
301-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error
302230
- name: unhandled-error
303-
disabled: false
304231
arguments:
305232
- "fmt.Fprint"
306233
- "fmt.Fprintf"
307234
- "fmt.Fprintln"
308235
- "fmt.Print"
309236
- "fmt.Printf"
310237
- "fmt.Println"
311-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unnecessary-stmt
312238
- name: unnecessary-stmt
313-
disabled: false
314-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break
315239
- name: useless-break
316-
disabled: false
317-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value
240+
- name: var-declaration
241+
- name: var-naming
242+
arguments:
243+
- ["ID"] # AllowList
244+
- ["Otel", "Aws", "Gcp"] # DenyList
318245
- name: waitgroup-by-value
319-
disabled: false
320246
testifylint:
321247
enable-all: true
322248
disable:

0 commit comments

Comments
 (0)