You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# With the read-only mode linter will fail if go.mod file is outdated.
28
19
modules-download-mode: readonly
29
20
@@ -45,12 +36,11 @@ linters:
45
36
- asciicheck # checks that your code does not contain non-ASCII identifiers
46
37
- bidichk # checks for dangerous unicode character sequences
47
38
- bodyclose # checks whether HTTP response body is closed successfully
48
-
- cyclop # checks function and package cyclomatic complexity
39
+
#- cyclop # checks function and package cyclomatic complexity
49
40
- dupl # tool for code clone detection
50
41
- durationcheck # checks for two durations multiplied together
51
42
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
52
43
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
53
-
- execinquery # checks query string in Query function which reads your Go src files and warning it finds
54
44
- exhaustive # checks exhaustiveness of enum switch statements
55
45
- exportloopref # checks for pointers to enclosing loop variables
56
46
- forbidigo # forbids identifiers
@@ -69,7 +59,6 @@ linters:
69
59
- gomodguard # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations
70
60
- goprintffuncname # checks that printf-like functions are named with f at the end
71
61
- gosec # inspects source code for security problems
72
-
- lll # reports long lines
73
62
- loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap)
74
63
- makezero # finds slice declarations with non-zero initial length
75
64
- mirror # reports wrong mirror patterns of bytes/strings usage
@@ -101,15 +90,13 @@ linters:
101
90
- usestdlibvars # detects the possibility to use variables/constants from the Go standard library
- whitespace # detects leading and trailing whitespace
104
-
- contextcheck # Check whether the function uses a non-inherited context.
105
93
- misspell # finds commonly misspelled English words in comments
106
94
- prealloc # can be used to find slice declarations that could potentially be preallocated
107
95
- thelper # detects golang test helpers without t.Helper() call and checks the consistency of test helpers
108
96
- containedctx # detects struct contained context.Context field
109
97
- decorder # checks declaration order and count of types, constants, variables and functions
110
98
- dogsled # checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
111
-
# - exhaustruct # [highly recommend to enable] checks if all structure fields are initialized
112
-
- nlreturn # checks for a new line before return and branch statements to increase code clarity
99
+
- paralleltest # detects missing usage of t.Parallel() method in your Go test
113
100
114
101
## you may want to enable
115
102
#- gci # controls golang package import order and makes it always deterministic
@@ -123,8 +110,11 @@ linters:
123
110
#- varnamelen # [great idea, but too many false positives] checks that the length of a variable's name matches its scope
124
111
#- wrapcheck # checks that errors returned from external packages are wrapped
125
112
#- zerologlint # detects the wrong usage of zerolog that a user forgets to dispatch zerolog.Event
113
+
# - nlreturn # checks for a new line before return and branch statements to increase code clarity
126
114
127
115
## disabled
116
+
# - lll # reports long lines
117
+
# - exhaustruct # [highly recommend to enable] checks if all structure fields are initialized
128
118
#- depguard # [replaced by gomodguard] checks if package imports are in a list of acceptable packages
129
119
#- dupword # [useless without config] checks for duplicate words in the source code
130
120
#- errchkjson # [don't see profit + I'm against of omitting errors like in the first example https://github.com/breml/errchkjson] checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted
@@ -136,13 +126,15 @@ linters:
136
126
#- grouper # analyzes expression groups
137
127
#- importas # enforces consistent import aliases
138
128
#- maintidx # measures the maintainability index of each function
139
-
#- paralleltest # [too many false positives] detects missing usage of t.Parallel() method in your Go test
140
129
#- wsl # [too strict and mostly code is not more readable] whitespace linter forces you to use empty lines
141
130
#- tagliatelle # checks the struct tags
131
+
#- contextcheck # Check whether the function uses a non-inherited context.
142
132
143
133
# This file contains only configs which differ from defaults.
144
134
# All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
145
135
linters-settings:
136
+
nestif:
137
+
min-complexity: 8
146
138
cyclop:
147
139
# The maximal code complexity to report.
148
140
# Default: 10
@@ -168,7 +160,7 @@ linters-settings:
168
160
- map
169
161
170
162
nlreturn:
171
-
block-size: 120
163
+
block-size: 8
172
164
173
165
exhaustruct:
174
166
# Default: []
@@ -202,18 +194,19 @@ linters-settings:
202
194
# Checks the number of lines in a function.
203
195
# If lower than 0, disable the check.
204
196
# Default: 60
205
-
lines: 100
197
+
lines: 150
206
198
# Checks the number of statements in a function.
207
199
# If lower than 0, disable the check.
208
200
# Default: 40
209
-
statements: 50
201
+
statements: 60
210
202
# Ignore comments when counting lines.
211
203
# Default false
212
204
ignore-comments: true
213
205
214
206
gocognit:
215
207
# Minimal code complexity to report.
216
-
min-complexity: 30
208
+
# Default: 30 (but we recommend 10-20)
209
+
min-complexity: 70
217
210
218
211
gocritic:
219
212
# Settings passed to gocritic.
@@ -256,12 +249,6 @@ linters-settings:
256
249
# Default: []
257
250
disable:
258
251
- fieldalignment # too strict
259
-
# Settings per analyzer.
260
-
settings:
261
-
shadow:
262
-
# Whether to be strict about shadowing; can be noisy.
263
-
# Default: false
264
-
strict: true
265
252
266
253
nakedret:
267
254
# Make an issue if func has more lines of code than this setting, and it has naked returns.
@@ -297,6 +284,15 @@ issues:
297
284
# Default: 3
298
285
max-same-issues: 50
299
286
287
+
# Don't lint the vendor or example directories.
288
+
exclude-dirs:
289
+
- ^vendor$
290
+
- examples
291
+
292
+
# When enabled, the following directories: are going to be skipped: vendor$,
0 commit comments