@@ -67,6 +67,12 @@ output:
67
67
68
68
# all available settings of specific linters
69
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
70
76
errcheck :
71
77
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
72
78
# default is false: such cases aren't reported by default.
@@ -84,11 +90,64 @@ linters-settings:
84
90
# path to a file containing a list of functions to exclude from checking
85
91
# see https://github.com/kisielk/errcheck#excluding-functions for details
86
92
exclude : /path/to/file.txt
87
-
88
93
funlen :
89
94
lines : 60
90
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
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
91
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
92
151
govet :
93
152
# report about shadowed variables
94
153
check-shadowing : true
@@ -109,33 +168,6 @@ linters-settings:
109
168
disable :
110
169
- shadow
111
170
disable-all : false
112
- golint :
113
- # minimal confidence for issues, default is 0.8
114
- min-confidence : 0.8
115
- gofmt :
116
- # simplify code: gofmt with `-s` option, true by default
117
- simplify : true
118
- goimports :
119
- # put imports beginning with prefix after 3rd-party packages;
120
- # it's a comma-separated list of prefixes
121
- local-prefixes : github.com/org/project
122
- gocyclo :
123
- # minimal code complexity to report, 30 by default (but we recommend 10-20)
124
- min-complexity : 10
125
- gocognit :
126
- # minimal code complexity to report, 30 by default (but we recommend 10-20)
127
- min-complexity : 10
128
- maligned :
129
- # print struct with more effective memory layout or not, false by default
130
- suggest-new : true
131
- dupl :
132
- # tokens count to trigger issue, 150 by default
133
- threshold : 100
134
- goconst :
135
- # minimal length of string constant, 3 by default
136
- min-len : 3
137
- # minimal occurrences count to trigger, 3 by default
138
- min-occurrences : 3
139
171
depguard :
140
172
list-type : blacklist
141
173
include-go-root : false
@@ -144,34 +176,22 @@ linters-settings:
144
176
packages-with-error-message :
145
177
# specify an error message to output when a blacklisted package is used
146
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
147
188
misspell :
148
189
# Correct spellings using locale preferences for US or UK.
149
190
# Default is to use a neutral variety of English.
150
191
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
151
192
locale : US
152
193
ignore-words :
153
194
- someword
154
- lll :
155
- # max line length, lines longer will be reported. Default is 120.
156
- # '\t' is counted as 1 character by default, and can be changed with the tab-width option
157
- line-length : 120
158
- # tab width in spaces. Default to 1.
159
- tab-width : 1
160
- rowserrcheck :
161
- packages :
162
- - github.com/jmoiron/sqlx
163
- unused :
164
- # treat code as a program (not a library) and report unused exported identifiers; default is false.
165
- # XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
166
- # if it's called for subdir of a project it can't find funcs usages. All text editor integrations
167
- # with golangci-lint call it on a directory with the changed file.
168
- check-exported : false
169
- unparam :
170
- # Inspect exported functions, default is false. Set to true if no external program/library imports your code.
171
- # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
172
- # if it's called for subdir of a project it can't find external interfaces. All text editor integrations
173
- # with golangci-lint call it on a directory with the changed file.
174
- check-exported : false
175
195
nakedret :
176
196
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
177
197
max-func-lines : 30
@@ -184,39 +204,21 @@ linters-settings:
184
204
simple : true
185
205
range-loops : true # Report preallocation suggestions on range loops, true by default
186
206
for-loops : false # Report preallocation suggestions on for loops, false by default
187
- gocritic :
188
- # Which checks should be enabled; can't be combined with 'disabled-checks';
189
- # See https://go-critic.github.io/overview#checks-overview
190
- # To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
191
- # By default list of stable checks is used.
192
- enabled-checks :
193
- - rangeValCopy
194
-
195
- # Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
196
- disabled-checks :
197
- - regexpMust
198
-
199
- # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
200
- # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
201
- enabled-tags :
202
- - performance
203
-
204
- settings : # settings passed to gocritic
205
- captLocal : # must be valid enabled check name
206
- paramsOnly : true
207
- rangeValCopy :
208
- sizeThreshold : 32
209
- godox :
210
- # report any comments starting with keywords, this is useful for TODO or FIXME comments that
211
- # might be left in the code accidentally and should be resolved before merging
212
- keywords : # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
213
- - NOTE
214
- - OPTIMIZE # marks code that should be optimized before merging
215
- - HACK # marks hack-arounds that should be removed before merging
216
- dogsled :
217
- # checks assignments with too many blank identifiers; default is 2
218
- max-blank-identifiers : 2
219
-
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
220
222
whitespace :
221
223
multi-if : false # Enforces newlines (or comments) after every multi-line if statement
222
224
multi-func : false # Enforces newlines (or comments) after every multi-line function signature
0 commit comments