7
7
concurrency : 4
8
8
9
9
# timeout for analysis, e.g. 30s, 5m, default is 1m
10
- deadline : 1m
10
+ timeout : 1m
11
11
12
12
# exit code when at least one issue was found, default is 1
13
13
issues-exit-code : 1
19
19
build-tags :
20
20
- mytag
21
21
22
- # which dirs to skip: they won't be analyzed ;
22
+ # which dirs to skip: issues from them won't be reported ;
23
23
# can use regexp here: generated.*, regexp is applied on full path;
24
- # default value is empty list, but next dirs are always skipped independently
25
- # from this option's value:
26
- # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
24
+ # default value is empty list, but default dirs are skipped independently
25
+ # from this option's value (see skip-dirs-use-default).
27
26
skip-dirs :
28
27
- src/external_libs
29
28
- autogenerated_by_my_lib
30
29
30
+ # default is true. Enables skipping of directories:
31
+ # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
32
+ skip-dirs-use-default : true
33
+
31
34
# which files to skip: they will be analyzed, but issues from them
32
35
# won't be reported. Default value is empty list, but there is
33
36
# no need to include all autogenerated files, we confidently recognize
@@ -58,11 +61,20 @@ output:
58
61
# print linter name in the end of issue text, default is true
59
62
print-linter-name : true
60
63
64
+ # make issues output unique by line, default is true
65
+ uniq-by-line : true
66
+
61
67
62
68
# all available settings of specific linters
63
69
linters-settings :
70
+ dogsled :
71
+ # checks assignments with too many blank identifiers; default is 2
72
+ max-blank-identifiers : 2
73
+ dupl :
74
+ # tokens count to trigger issue, 150 by default
75
+ threshold : 100
64
76
errcheck :
65
- # report about not checking of errors in type assetions : `a := b.(MyStruct)`;
77
+ # report about not checking of errors in type assertions : `a := b.(MyStruct)`;
66
78
# default is false: such cases aren't reported by default.
67
79
check-type-assertions : false
68
80
@@ -78,11 +90,64 @@ linters-settings:
78
90
# path to a file containing a list of functions to exclude from checking
79
91
# see https://github.com/kisielk/errcheck#excluding-functions for details
80
92
exclude : /path/to/file.txt
81
-
82
93
funlen :
83
94
lines : 60
84
95
statements : 40
96
+ gocognit :
97
+ # minimal code complexity to report, 30 by default (but we recommend 10-20)
98
+ min-complexity : 10
99
+ goconst :
100
+ # minimal length of string constant, 3 by default
101
+ min-len : 3
102
+ # minimal occurrences count to trigger, 3 by default
103
+ min-occurrences : 3
104
+ gocritic :
105
+ # Which checks should be enabled; can't be combined with 'disabled-checks';
106
+ # See https://go-critic.github.io/overview#checks-overview
107
+ # To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
108
+ # By default list of stable checks is used.
109
+ enabled-checks :
110
+ - rangeValCopy
111
+
112
+ # Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
113
+ disabled-checks :
114
+ - regexpMust
85
115
116
+ # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
117
+ # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
118
+ enabled-tags :
119
+ - performance
120
+
121
+ settings : # settings passed to gocritic
122
+ captLocal : # must be valid enabled check name
123
+ paramsOnly : true
124
+ rangeValCopy :
125
+ sizeThreshold : 32
126
+ gocyclo :
127
+ # minimal code complexity to report, 30 by default (but we recommend 10-20)
128
+ min-complexity : 10
129
+ godox :
130
+ # report any comments starting with keywords, this is useful for TODO or FIXME comments that
131
+ # might be left in the code accidentally and should be resolved before merging
132
+ keywords : # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
133
+ - NOTE
134
+ - OPTIMIZE # marks code that should be optimized before merging
135
+ - HACK # marks hack-arounds that should be removed before merging
136
+ gofmt :
137
+ # simplify code: gofmt with `-s` option, true by default
138
+ simplify : true
139
+ goimports :
140
+ # put imports beginning with prefix after 3rd-party packages;
141
+ # it's a comma-separated list of prefixes
142
+ local-prefixes : github.com/org/project
143
+ golint :
144
+ # minimal confidence for issues, default is 0.8
145
+ min-confidence : 0.8
146
+ gomnd :
147
+ settings :
148
+ mnd :
149
+ # the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description.
150
+ checks : argument,case,condition,operation,return,assign
86
151
govet :
87
152
# report about shadowed variables
88
153
check-shadowing : true
@@ -103,63 +168,30 @@ linters-settings:
103
168
disable :
104
169
- shadow
105
170
disable-all : false
106
- golint :
107
- # minimal confidence for issues, default is 0.8
108
- min-confidence : 0.8
109
- gofmt :
110
- # simplify code: gofmt with `-s` option, true by default
111
- simplify : true
112
- goimports :
113
- # put imports beginning with prefix after 3rd-party packages;
114
- # it's a comma-separated list of prefixes
115
- local-prefixes : github.com/org/project
116
- gocyclo :
117
- # minimal code complexity to report, 30 by default (but we recommend 10-20)
118
- min-complexity : 10
119
- maligned :
120
- # print struct with more effective memory layout or not, false by default
121
- suggest-new : true
122
- dupl :
123
- # tokens count to trigger issue, 150 by default
124
- threshold : 100
125
- goconst :
126
- # minimal length of string constant, 3 by default
127
- min-len : 3
128
- # minimal occurrences count to trigger, 3 by default
129
- min-occurrences : 3
130
171
depguard :
131
172
list-type : blacklist
132
173
include-go-root : false
133
174
packages :
134
175
- github.com/sirupsen/logrus
135
- packages-with-error-messages :
176
+ packages-with-error-message :
136
177
# specify an error message to output when a blacklisted package is used
137
- github.com/sirupsen/logrus : " logging is allowed only by logutils.Log"
178
+ - github.com/sirupsen/logrus : " logging is allowed only by logutils.Log"
179
+ lll :
180
+ # max line length, lines longer will be reported. Default is 120.
181
+ # '\t' is counted as 1 character by default, and can be changed with the tab-width option
182
+ line-length : 120
183
+ # tab width in spaces. Default to 1.
184
+ tab-width : 1
185
+ maligned :
186
+ # print struct with more effective memory layout or not, false by default
187
+ suggest-new : true
138
188
misspell :
139
189
# Correct spellings using locale preferences for US or UK.
140
190
# Default is to use a neutral variety of English.
141
191
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
142
192
locale : US
143
193
ignore-words :
144
194
- someword
145
- lll :
146
- # max line length, lines longer will be reported. Default is 120.
147
- # '\t' is counted as 1 character by default, and can be changed with the tab-width option
148
- line-length : 120
149
- # tab width in spaces. Default to 1.
150
- tab-width : 1
151
- unused :
152
- # treat code as a program (not a library) and report unused exported identifiers; default is false.
153
- # XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
154
- # if it's called for subdir of a project it can't find funcs usages. All text editor integrations
155
- # with golangci-lint call it on a directory with the changed file.
156
- check-exported : false
157
- unparam :
158
- # Inspect exported functions, default is false. Set to true if no external program/library imports your code.
159
- # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
160
- # if it's called for subdir of a project it can't find external interfaces. All text editor integrations
161
- # with golangci-lint call it on a directory with the changed file.
162
- check-exported : false
163
195
nakedret :
164
196
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
165
197
max-func-lines : 30
@@ -172,47 +204,56 @@ linters-settings:
172
204
simple : true
173
205
range-loops : true # Report preallocation suggestions on range loops, true by default
174
206
for-loops : false # Report preallocation suggestions on for loops, false by default
175
- gocritic :
176
- # Which checks should be enabled; can't be combined with 'disabled-checks';
177
- # See https://go-critic.github.io/overview#checks-overview
178
- # To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
179
- # By default list of stable checks is used.
180
- enabled-checks :
181
- - rangeValCopy
182
-
183
- # Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
184
- disabled-checks :
185
- - regexpMust
186
-
187
- # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
188
- # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
189
- enabled-tags :
190
- - performance
191
-
192
- settings : # settings passed to gocritic
193
- captLocal : # must be valid enabled check name
194
- paramsOnly : true
195
- rangeValCopy :
196
- sizeThreshold : 32
197
- godox :
198
- # report any comments starting with keywords, this is useful for TODO or FIXME comments that
199
- # might be left in the code accidentally and should be resolved before merging
200
- keywords : # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
201
- - NOTE
202
- - OPTIMIZE # marks code that should be optimized before merging
203
- - HACK # marks hack-arounds that should be removed before merging
204
- dogsled :
205
- # checks assignments with too many blank identifiers; default is 2
206
- max-blank-identifiers : 2
207
-
207
+ rowserrcheck :
208
+ packages :
209
+ - github.com/jmoiron/sqlx
210
+ unparam :
211
+ # Inspect exported functions, default is false. Set to true if no external program/library imports your code.
212
+ # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
213
+ # if it's called for subdir of a project it can't find external interfaces. All text editor integrations
214
+ # with golangci-lint call it on a directory with the changed file.
215
+ check-exported : false
216
+ unused :
217
+ # treat code as a program (not a library) and report unused exported identifiers; default is false.
218
+ # XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
219
+ # if it's called for subdir of a project it can't find funcs usages. All text editor integrations
220
+ # with golangci-lint call it on a directory with the changed file.
221
+ check-exported : false
208
222
whitespace :
209
- multi-if : false
223
+ multi-if : false # Enforces newlines (or comments) after every multi-line if statement
224
+ multi-func : false # Enforces newlines (or comments) after every multi-line function signature
225
+ wsl :
226
+ # If true append is only allowed to be cuddled if appending value is
227
+ # matching variables, fields or types on line above. Default is true.
228
+ strict-append : true
229
+ # Allow calls and assignments to be cuddled as long as the lines have any
230
+ # matching variables, fields or types. Default is true.
231
+ allow-assign-and-call : true
232
+ # Allow multiline assignments to be cuddled. Default is true.
233
+ allow-multiline-assign : true
234
+ # Allow declarations (var) to be cuddled.
235
+ allow-cuddle-declarations : false
236
+ # Allow trailing comments in ending of blocks
237
+ allow-trailing-comment : false
238
+ # Force newlines in end of case at this limit (0 = never).
239
+ force-case-trailing-whitespace : 0
240
+
241
+ # The custom section can be used to define linter plugins to be loaded at runtime. See README doc
242
+ # for more info.
243
+ custom :
244
+ # Each custom linter should have a unique name.
245
+ example :
246
+ # The path to the plugin *.so. Can be absolute or local. Required for each custom linter
247
+ path : /path/to/example.so
248
+ # The description of the linter. Optional, just for documentation purposes.
249
+ description : This is an example usage of a plugin linter.
250
+ # Intended to point to the repo location of the linter. Optional, just for documentation purposes.
251
+ original-url : github.com/golangci/example-linter
210
252
211
253
linters :
212
254
enable :
213
255
- megacheck
214
256
- govet
215
- enable-all : false
216
257
disable :
217
258
- maligned
218
259
- prealloc
0 commit comments