Repository navigation
Expand file tree
/
Copy path.golangci.yml
More file actions
67 lines (67 loc) · 2.17 KB
/
Copy path.golangci.yml
File metadata and controls
67 lines (67 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
version: "2"
linters:
default: all
disable:
- cyclop # covered by gocyclo
- depguard # unnecessary for small libraries
- exhaustruct # deprecated, replaced by exhaustruct_v5
- funlen # rely on code review to limit function length
- gocognit # dubious "cognitive overhead" quantification
- gomodguard # deprecated, replaced by gomodguard_v2
- inamedparam # convention is not followed
- ireturn # "accept interfaces, return structs" isn't ironclad
- lll # don't want hard limits for line length
- maintidx # covered by gocyclo
- mnd # some unnamed constants are okay
- nlreturn # generous whitespace violates house style
- noinlineerr # inline error handling is fine
- nonamedreturns # named returns are fine; it's *bare* returns that are bad
- testpackage # internal tests are fine
- wrapcheck # don't _always_ need to wrap errors
- wsl # generous whitespace violates house style
- wsl_v5 # generous whitespace violates house style
settings:
errcheck:
check-type-assertions: true
exhaustruct_v5:
# No zero values for param structs.
explicit-mode: true
enforce-patterns:
- connectrpc\.com/grpchealth/v2\..*[pP]arams
forbidigo:
forbid:
- pattern: ^fmt\.Print
- pattern: ^log\.
- pattern: ^print$
- pattern: ^println$
- pattern: ^panic$
godox:
# TODO, OPT, etc. comments are fine to commit. Use FIXME comments for
# temporary hacks, and use godox to prevent committing them.
keywords:
- FIXME
varnamelen:
ignore-decls:
- T any
- i int
- t *testing.T
- tb testing.TB
- wg sync.WaitGroup
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- err113
path: (.+)\.go$
text: do not define dynamic errors.*
formatters:
enable:
- gci
- gofmt
exclusions:
generated: lax