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
* chore: cleanup local golangci
* remove different golangci-config
* add merge group step to push step
* upgrade golangci to 1.56
* update golangci action
* try skip cache golangci/golangci-lint-action#863
* try single golangci-lint
* don't set only new issues in config
* Update checks.yaml
Co-authored-by: Dave Mihalcik <[email protected]>
* log context
* point to commit
* only new issues on pr or merge group
---------
Co-authored-by: Dave Mihalcik <[email protected]>
# If it's higher than 0.0 (float) the check is enabled
26
-
# Default: 0.0
27
-
package-average: 10.0
28
-
29
10
errcheck:
30
11
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
31
12
# Such cases aren't reported by default.
@@ -39,21 +20,6 @@ linters-settings:
39
20
- switch
40
21
- map
41
22
42
-
funlen:
43
-
# Checks the number of lines in a function.
44
-
# If lower than 0, disable the check.
45
-
# Default: 60
46
-
lines: 100
47
-
# Checks the number of statements in a function.
48
-
# If lower than 0, disable the check.
49
-
# Default: 40
50
-
statements: 50
51
-
52
-
gocognit:
53
-
# Minimal code complexity to report.
54
-
# Default: 30 (but we recommend 10-20)
55
-
min-complexity: 20
56
-
57
23
gocritic:
58
24
# Settings passed to gocritic.
59
25
# The settings key is the name of a supported gocritic checker.
@@ -83,7 +49,6 @@ linters-settings:
83
49
- prometheus.ExponentialBuckets
84
50
- prometheus.ExponentialBucketsRange
85
51
- prometheus.LinearBuckets
86
-
- wg.Add
87
52
88
53
gomodguard:
89
54
blocked:
@@ -127,7 +92,7 @@ linters-settings:
127
92
nolintlint:
128
93
# Exclude following linters from requiring an explanation.
129
94
# Default: []
130
-
allow-no-explanation: [ funlen, gocognit, lll ]
95
+
allow-no-explanation: []
131
96
# Enable to require an explanation of nonzero length after each nolint directive.
132
97
# Default: false
133
98
require-explanation: true
@@ -147,21 +112,6 @@ linters-settings:
147
112
# Default: false
148
113
all: true
149
114
150
-
lll:
151
-
line-length: 120
152
-
153
-
wrapcheck:
154
-
ignoreSigs:
155
-
- "status.Error("
156
-
- ".Errorf("
157
-
- "errors.New("
158
-
- "errors.Unwrap("
159
-
- "errors.Join("
160
-
- ".Wrap("
161
-
- ".Wrapf("
162
-
- ".WithMessage("
163
-
- ".WithMessagef("
164
-
- ".WithStack("
165
115
linters:
166
116
disable-all: true
167
117
enable:
@@ -178,31 +128,26 @@ linters:
178
128
- asciicheck # checks that your code does not contain non-ASCII identifiers
179
129
- bidichk # checks for dangerous unicode character sequences
180
130
- bodyclose # checks whether HTTP response body is closed successfully
181
-
- cyclop # checks function and package cyclomatic complexity
182
-
- dupl # tool for code clone detection
131
+
- containedctx # Containedctx is a linter that detects struct contained context.Context field.
132
+
- contextcheck # checks the function whether use a non-inherited context
133
+
#- copyloopvar # checks for copying a loop variable to a function literal (1.57)
183
134
- durationcheck # checks for two durations multiplied together
184
135
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
185
136
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
186
137
- execinquery # checks query string in Query function which reads your Go src files and warning it finds
187
138
- exhaustive # checks exhaustiveness of enum switch statements
188
139
- exportloopref # checks for pointers to enclosing loop variables
189
140
- forbidigo # forbids identifiers
190
-
- funlen#tool for detection of long functions
141
+
- forcetypeassert#finds forced type assertions
191
142
- gocheckcompilerdirectives # validates go compiler directive comments (//go:)
192
-
- gochecknoglobals # checks that no global variables exist
193
-
#- gochecknoinits # checks that no init functions are present in Go code
194
-
- gocognit # computes and checks the cognitive complexity of functions
195
143
- goconst # finds repeated strings that could be replaced by a constant
196
144
- gocritic # provides diagnostics that check for bugs, performance and style issues
197
-
- gocyclo # computes and checks the cyclomatic complexity of functions
198
-
# - godot # checks if comments end in a period
145
+
- gofmt # checks whether code was gofmt-ed
199
146
- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
200
147
- gomnd # detects magic numbers
201
-
# - gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
202
148
- 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
203
149
- goprintffuncname # checks that printf-like functions are named with f at the end
204
150
- gosec # inspects source code for security problems
205
-
- lll # reports long lines
206
151
- loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap)
207
152
- makezero # finds slice declarations with non-zero initial length
208
153
- musttag # enforces field tags in (un)marshaled structs
@@ -216,13 +161,17 @@ linters:
216
161
- nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL
217
162
- predeclared # finds code that shadows one of Go's predeclared identifiers
218
163
- promlinter # checks Prometheus metrics naming via promlint
164
+
- protogetter # Reports direct reads from proto message fields when getters should be used.
219
165
- reassign # checks that package variables are not reassigned
220
166
- revive # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint
221
167
- rowserrcheck # checks whether Err of rows is checked successfully
168
+
- sloglint # Ensure consistent code style when using log/slog.
169
+
- spancheck # checks for incorrect usage of opentracing.Span
222
170
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
223
171
- stylecheck # is a replacement for golint
224
172
- tenv # detects using os.Setenv instead of t.Setenv since Go1.17
225
173
- testableexamples # checks if examples are testable (have an expected output)
174
+
- testifylint
226
175
#- testpackage # makes you use a separate _test package
227
176
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
228
177
- unconvert # removes unnecessary type conversions
- prealloc # [premature optimization, but can be used in some cases] finds slice declarations that could potentially be preallocated
243
-
#- varnamelen # [great idea, but too many false positives] checks that the length of a variable's name matches its scope
244
-
- wrapcheck # checks that errors returned from external packages are wrapped
245
-
246
-
## disabled
247
-
#- containedctx # detects struct contained context.Context field
248
-
#- contextcheck # [too many false positives] checks the function whether use a non-inherited context
249
-
#- depguard # [replaced by gomodguard] checks if package imports are in a list of acceptable packages
250
-
#- dogsled # checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
251
-
#- dupword # [useless without config] checks for duplicate words in the source code
252
-
#- 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
253
-
#- forcetypeassert # [replaced by errcheck] finds forced type assertions
254
-
#- goerr113 # [too strict] checks the errors handling expressions
255
-
#- gofmt # [replaced by goimports] checks whether code was gofmt-ed
256
-
#- gofumpt # [replaced by goimports, gofumports is not available yet] checks whether code was gofumpt-ed
257
-
#- grouper # analyzes expression groups
258
-
#- importas # enforces consistent import aliases
259
-
#- maintidx # measures the maintainability index of each function
260
-
#- misspell # [useless] finds commonly misspelled English words in comments
261
-
#- nlreturn # [too strict and mostly code is not more readable] checks for a new line before return and branch statements to increase code clarity
262
-
#- paralleltest # [too many false positives] detects missing usage of t.Parallel() method in your Go test
263
-
#- tagliatelle # checks the struct tags
264
-
#- thelper # detects golang test helpers without t.Helper() call and checks the consistency of test helpers
265
-
#- wsl # [too strict and mostly code is not more readable] whitespace linter forces you to use empty lines
266
-
267
-
## deprecated
268
-
#- deadcode # [deprecated, replaced by unused] finds unused code
269
-
#- exhaustivestruct # [deprecated, replaced by exhaustruct] checks if all struct's fields are initialized
270
-
#- golint # [deprecated, replaced by revive] golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes
271
-
#- ifshort # [deprecated] checks that your code uses short syntax for if-statements whenever possible
0 commit comments