-
Notifications
You must be signed in to change notification settings - Fork 10
/
.golangci.yml
218 lines (215 loc) · 5.72 KB
/
.golangci.yml
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
run:
build-tags:
- dev
timeout: 10m
modules-download-mode: vendor
go: 1.22
linters:
disable-all: true
enable:
- bodyclose
- errname
- gofmt
- goimports
- govet
- ineffassign
- staticcheck
- unused
- revive
issues:
max-issues-per-linter: 100
max-same-issues: 100
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- bodyclose
linters-settings:
staticcheck:
# Disabled checks:
# - SA1019: Using a deprecated function, variable, constant or field
# - SA9003: Empty body in an if or else branch
checks: ["all", "-SA1019", "-SA9003"]
revive:
rules:
- name: add-constant
disabled: true
- name: atomic
disabled: false
severity: error
- name: argument-limit
disabled: false
- name: banned-characters
disabled: false
severity: error
- name: bare-return
disabled: true
- name: blank-imports
disabled: false
severity: error
- name: bool-literal-in-expr
disabled: false
- name: call-to-gc
disabled: false
- name: cognitive-complexity # revisit periodically - exclude tests
disabled: false
arguments: [65] # emprically set to upper bound
- name: comment-spacings
disabled: false
- name: confusing-naming # too opinionated
disabled: true
- name: confusing-results
disabled: false
- name: constant-logical-expr
disabled: false
severity: error
- name: context-as-argument
disabled: false
- name: context-keys-type
disabled: false
- name: cyclomatic # revisit - exclude tests
disabled: false
arguments: [92] # emprically set to upper bound
- name: datarace
disabled: false
severity: error
- name: deep-exit
disabled: false
- name: defer # often wrong
disabled: false
- name: dot-imports
disabled: false
severity: error
- name: duplicated-imports
disabled: false
severity: error
- name: early-return
disabled: false
- name: empty-block
disabled: false
- name: empty-lines # maybe correct but annoying
disabled: true
- name: enforce-map-style
disabled: false
severity: error
- name: enforce-slice-style
disabled: false
severity: error
- name: errorf
disabled: false
severity: error
- name: error-naming
disabled: false
severity: error
- name: error-return # fine, but unnecessarily picky
disabled: false
- name: error-strings # fine, but unnecessarily picky
disabled: false
- name: exported # possibly too opinionated
disabled: false
- name: file-header
disabled: false
severity: error
- name: flag-parameter # often wrong
disabled: true
- name: function-length # revisit - exclude tests
disabled: false
arguments: [136, 702] # emprically set to upper bound
- name: function-result-limit
disabled: false
- name: get-return
disabled: false
- name: identical-branches
disabled: false
severity: error
- name: if-return # reasonable candidate but too opinonated
disabled: false
- name: import-alias-naming
disabled: false
- name: import-shadowing # sounds nice, but too many good variable names are taken up by packages.
disabled: false
- name: increment-decrement # just style
disabled: false
- name: indent-error-flow # fine, but unnecessarily picky
disabled: true
- name: line-length-limit
disabled: true
- name: max-public-structs # too opinionated
disabled: true
- name: modifies-parameter
disabled: false
severity: error
- name: modifies-value-receiver
disabled: false
severity: error
- name: nested-structs # deliberately used in some places
disabled: true
- name: optimize-operands-order
disabled: false
severity: error
- name: package-comments
disabled: false
severity: error
- name: range
disabled: false
severity: error
- name: range-val-address
disabled: false
severity: error
- name: range-val-in-closure
disabled: false
severity: error
- name: receiver-naming # unnecessarily picky
disabled: true
- name: redefines-builtin-id # useful
disabled: false
- name: redundant-import-alias
disabled: false
- name: string-of-int
disabled: false
severity: error
- name: string-format
disabled: false
severity: error
- name: struct-tag # often wrong
disabled: false
- name: superfluous-else
disabled: false
severity: error
- name: time-equal
disabled: false
severity: error
- name: time-naming
disabled: false
- name: unchecked-type-assertion # a panic here is sometimes correct as a programming error
disabled: false
- name: unconditional-recursion
disabled: false
severity: error
- name: unexported-naming
disabled: false
severity: error
- name: unexported-return
disabled: false
- name: unhandled-error # complains about e.g. fmt.Println
disabled: true
- name: unnecessary-stmt # opinionated
disabled: false
- name: unreachable-code
disabled: false
severity: error
- name: unused-parameter
disabled: false
- name: unused-receiver # too picky
disabled: true
- name: useless-break
disabled: false
- name: use-any # opinionated
disabled: true
- name: var-declaration # too picky
disabled: false
- name: var-naming # incompatible with this codebase
disabled: true
- name: waitgroup-by-value
disabled: false
severity: error