-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy path.golangci.yml
More file actions
101 lines (101 loc) · 2.94 KB
/
.golangci.yml
File metadata and controls
101 lines (101 loc) · 2.94 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
version: "2"
linters:
default: all
disable:
- cyclop # covered by gocyclo
- depguard # not needed
- exhaustruct
- funlen # rely on code review to limit function length
- gochecknoglobals # sometimes useful to declare constants
- gocognit # dubious "cognitive overhead" quantification
- 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
- nilnil # (T, error) returning (nil, nil) is an acceptable "no result" signal
- nlreturn # generous whitespace violates house style
- noinlineerr # excess scope violates house style
- rowserrcheck # no SQL code in plugins
- sqlclosecheck # no SQL code in plugins
- testpackage # internal tests are fine
- varnamelen
- wastedassign # not supported with generics
- 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
forbidigo:
forbid:
- pattern: ^fmt\.Print
- pattern: ^print$
- pattern: ^println$
- pattern: ^panic$
godox:
keywords:
- FIXME
sloglint:
attr-only: true
context: all
usetesting:
context-background: true
context-todo: true
perfsprint:
# Prefer sprintf for readability
string-format: false
tagliatelle:
# Check the struct tag name case.
case:
rules:
json: snake
yaml: snake
varnamelen:
ignore-decls:
- T any
- i int
- wg sync.WaitGroup
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- err113
text: do not define dynamic errors
# G703: Path traversal via taint analysis (very noisy)
- linters:
- gosec
text: G703
# G706: Log injection via taint analysis (very noisy)
- linters:
- gosec
text: G706
# dupword reports several errors in .proto test fixtures
# gosec reports a few minor issues in tests
# prealloc is not important in tests
- linters:
- dupword
- gosec
- prealloc
path: _test\.go
# internal/plugin predates this rule; renaming would be disruptive
- linters:
- revive
path: internal/plugin/
text: "var-naming: avoid package names"
formatters:
enable:
- gci
- gofmt
settings:
gci:
sections:
- standard
- default
- prefix(github.com/bufbuild/plugins)
exclusions:
generated: lax