Source
xxxxxxxxxx
1
-
# for golanci-lint version 1.55.2
1
+
# for golanci-lint version 1.61.0
2
2
# everything (linter definitions) should be sorted in alphabetical order by name
3
3
4
4
run:
5
5
timeout: 1m
6
6
allow-parallel-runners: true
7
7
8
8
output:
9
9
sort-results: true
10
10
11
11
linters-settings:
85
85
- name: function-result-limit
86
86
arguments:
87
87
- 4
88
88
89
89
- name: max-public-structs
90
90
arguments:
91
91
- 5
92
92
93
93
# disabled
94
94
95
-
# like gomnd, annoying#
95
+
# like gomnd, annoying
96
96
- name: add-constant
97
97
disabled: true
98
98
- name: banned-characters # useless, as every char needs to be configured
99
99
disabled: true
100
100
# common to have a public faceing signature and internal uglier signature
101
101
# Walk and walk (for example)
102
102
- name: confusing-naming
103
103
disabled: true
104
104
- name: confusing-results
105
105
disabled: true
106
106
# cyclomatic complexity checks are enough, no need to complicate life
107
107
# with two different metrics for complexity.
108
108
- name: cognitive-complexity
109
109
disabled: true
110
110
# duplicate
111
111
- name: cyclomatic
112
112
disabled: true
113
113
# duplicate
114
114
- name: file-header
115
115
disabled: true
116
-
# cool idea, but warning about ever bool param is not acceptable
116
+
# cool idea, but warning about every bool param is not acceptable
117
117
- name: flag-parameter
118
118
disabled: true
119
119
# cyclomatic complexety checks are enough
120
120
- name: function-length
121
121
disabled: true
122
122
# duplicate
123
123
- name: line-length-limit
124
124
disabled: true
125
125
# duplicate
126
126
- name: unhandled-error
127
127
disabled: true
128
-
# duplicate, + we have goheader
128
+
# duplicate
129
129
- name: package-comments
130
130
disabled: true
131
131
132
132
stylecheck:
133
133
checks:
134
134
- all
135
135
- -ST1000 # Incorrect or missing package comment
136
136
- -ST1003 # Poorly chosen identifier
137
137
dot-import-whitelist: []
138
138
http-status-code-whitelist: []
167
167
ignoreSigs:
168
168
# defaults
169
169
- .Errorf(
170
170
- errors.New(
171
171
- errors.Unwrap(
172
172
- .Wrap(
173
173
- .Wrapf(
174
174
- .WithMessage(
175
175
- .WithMessagef(
176
176
- .WithStack(
177
-
# zabbix'es custom errors
177
+
# zabbix custom errors
178
178
- errs.New(
179
-
- errs.WrapConst(
180
-
- errs.Wrap(
181
179
182
180
linters:
183
181
enable-all: true
184
182
disable:
185
183
# gomodguard is better
186
184
- depguard
187
185
188
186
# always check marshal errors
189
187
- errchkjson
190
188
191
189
# triggers on switches with default case.
192
190
- exhaustive
193
191
194
192
# allow use go default zero values .
195
193
- exhaustruct
196
194
197
195
# cyclomatic complexity checkers already enforce limit on function length.
198
196
# no need to count lines.
199
197
- funlen
200
198
201
-
# conflicts with gci and goimports. the formatter should still be used, only
202
-
# lint can't enforce it.
199
+
# conflicts with gci and goimports. the formatter should still be used,
200
+
# only lint can't enforce it.
203
201
- gofumpt
204
202
205
203
# conflicts with gofumpt and gci. the tool still should be used but gci
206
204
# needs be the last formatter.
207
205
- goimports
208
206
209
207
# not many cases when this is helpful were observed
210
-
- gomnd
211
-
212
-
# don't use shorthand ifs
213
-
- ifshort
208
+
- mnd
214
209
215
210
# revive warns about this
216
211
- nakedret
217
212
218
-
# current unit test situation is bad enough as it is. no need to introduce new
219
-
# unit testing practices.
213
+
# we don't do black box testing in unit tests.
220
214
- testpackage
221
215
222
216
# having one length vars is fine.
223
217
- varnamelen
224
218
225
219
# deprecated
226
-
- deadcode
227
-
- exhaustivestruct
228
-
- golint
229
-
- ifshort
230
-
- interfacer
231
-
- maligned
232
-
- nosnakecase
233
-
- scopelint
234
-
- structcheck
235
-
- varcheck
220
+
- execinquery
221
+
- exportloopref
222
+
- gomnd
236
223
237
224
issues:
238
225
exclude-use-default: false
239
226
max-issues-per-linter: 0 # unlimited
240
227
max-same-issues: 0 # unlimited
241
228
exclude-rules:
242
229
- path: _test\.go
243
230
linters:
231
+
- dupl
232
+
- err113
244
233
- errcheck
245
234
- gocritic
246
-
- goerr113
235
+
- maintidx
247
236
- revive
248
237
- wrapcheck
249
-
- maintidx
250
238
251
239
severity:
252
240
default-severity: error