@@ -261,6 +261,75 @@ linters:
261
261
# Default: false
262
262
fast : true
263
263
264
+ # Defines a set of rules to ignore issues.
265
+ # It does not skip the analysis, and so does not ignore "typecheck" errors.
266
+ exclusions :
267
+ # Mode of the generated files analysis.
268
+ #
269
+ # - `strict`: sources are excluded by strictly following the Go generated file convention.
270
+ # Source files that have lines matching only the following regular expression will be excluded: `^// Code generated .* DO NOT EDIT\.$`
271
+ # This line must appear before the first non-comment, non-blank text in the file.
272
+ # https://go.dev/s/generatedcode
273
+ # - `lax`: sources are excluded if they contain lines like `autogenerated file`, `code generated`, `do not edit`, etc.
274
+ # - `disable`: disable the generated files exclusion.
275
+ #
276
+ # Default: lax
277
+ generated : strict
278
+ # Log a warning if an exclusion rule is unused.
279
+ # Default: false
280
+ warn-unused : true
281
+ # Predefined exclusion rules.
282
+ # Default: []
283
+ presets :
284
+ - comments
285
+ - std-error-handling
286
+ - common-false-positives
287
+ - legacy
288
+
289
+ # Excluding configuration per-path, per-linter, per-text and per-source.
290
+ rules :
291
+ # Exclude some linters from running on tests files.
292
+ - path : _test\.go
293
+ linters :
294
+ - gocyclo
295
+ - errcheck
296
+ - dupl
297
+ - gosec
298
+
299
+ # Run some linter only for test files by excluding its issues for everything else.
300
+ - path-except : _test\.go
301
+ linters :
302
+ - forbidigo
303
+
304
+ # Exclude known linters from partially hard-vendored code,
305
+ # which is impossible to exclude via `nolint` comments.
306
+ # `/` will be replaced by the current OS file path separator to properly work on Windows.
307
+ - path : internal/hmac/
308
+ text : " weak cryptographic primitive"
309
+ linters :
310
+ - gosec
311
+
312
+ # Exclude some `staticcheck` messages.
313
+ - linters :
314
+ - staticcheck
315
+ text : " SA9003:"
316
+
317
+ # Exclude `lll` issues for long lines with `go:generate`.
318
+ - linters :
319
+ - lll
320
+ source : " ^//go:generate "
321
+
322
+ # Which file paths to exclude: they will be analyzed, but issues from them won't be reported.
323
+ # "/" will be replaced by the current OS file path separator to properly work on Windows.
324
+ # Default: []
325
+ paths :
326
+ - " .*\\ .my\\ .go$"
327
+ - lib/bad.go
328
+ # Which file paths to not exclude.
329
+ # Default: []
330
+ paths-except :
331
+ - " .*\\ .my\\ .go$"
332
+ - lib/bad.go
264
333
265
334
formatters :
266
335
# Enable specific formatter.
@@ -3940,116 +4009,6 @@ linters-settings:
3940
4009
3941
4010
3942
4011
issues :
3943
- # List of regexps of issue texts to exclude.
3944
- #
3945
- # But independently of this option we use default exclude patterns,
3946
- # it can be disabled by `exclude-use-default: false`.
3947
- # To list all excluded by default patterns execute `golangci-lint run --help`
3948
- #
3949
- # Default: https://golangci-lint.run/usage/false-positives/#default-exclusions
3950
- exclude :
3951
- - abcdef
3952
-
3953
- # Excluding configuration per-path, per-linter, per-text and per-source
3954
- exclude-rules :
3955
- # Exclude some linters from running on tests files.
3956
- - path : _test\.go
3957
- linters :
3958
- - gocyclo
3959
- - errcheck
3960
- - dupl
3961
- - gosec
3962
-
3963
- # Run some linter only for test files by excluding its issues for everything else.
3964
- - path-except : _test\.go
3965
- linters :
3966
- - forbidigo
3967
-
3968
- # Exclude known linters from partially hard-vendored code,
3969
- # which is impossible to exclude via `nolint` comments.
3970
- # `/` will be replaced by current OS file path separator to properly work on Windows.
3971
- - path : internal/hmac/
3972
- text : " weak cryptographic primitive"
3973
- linters :
3974
- - gosec
3975
-
3976
- # Exclude some `staticcheck` messages.
3977
- - linters :
3978
- - staticcheck
3979
- text : " SA9003:"
3980
-
3981
- # Exclude `lll` issues for long lines with `go:generate`.
3982
- - linters :
3983
- - lll
3984
- source : " ^//go:generate "
3985
-
3986
- # Independently of option `exclude` we use default exclude patterns,
3987
- # it can be disabled by this option.
3988
- # To list all excluded by default patterns execute `golangci-lint run --help`.
3989
- # Default: true
3990
- exclude-use-default : false
3991
-
3992
- # If set to true, `exclude` and `exclude-rules` regular expressions become case-sensitive.
3993
- # Default: false
3994
- exclude-case-sensitive : false
3995
-
3996
- # Which dirs to exclude: issues from them won't be reported.
3997
- # Can use regexp here: `generated.*`, regexp is applied on full path,
3998
- # including the path prefix if one is set.
3999
- # Default dirs are skipped independently of this option's value (see exclude-dirs-use-default).
4000
- # "/" will be replaced by current OS file path separator to properly work on Windows.
4001
- # Default: []
4002
- exclude-dirs :
4003
- - src/external_libs
4004
- - autogenerated_by_my_lib
4005
-
4006
- # Enables exclude of directories:
4007
- # - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
4008
- # Default: true
4009
- exclude-dirs-use-default : false
4010
-
4011
- # Which files to exclude: they will be analyzed, but issues from them won't be reported.
4012
- # There is no need to include all autogenerated files,
4013
- # we confidently recognize autogenerated files.
4014
- # If it's not, please let us know.
4015
- # "/" will be replaced by current OS file path separator to properly work on Windows.
4016
- # Default: []
4017
- exclude-files :
4018
- - " .*\\ .my\\ .go$"
4019
- - lib/bad.go
4020
-
4021
- # Mode of the generated files analysis.
4022
- #
4023
- # - `strict`: sources are excluded by following strictly the Go generated file convention.
4024
- # Source files that have lines matching only the following regular expression will be excluded: `^// Code generated .* DO NOT EDIT\.$`
4025
- # This line must appear before the first non-comment, non-blank text in the file.
4026
- # https://go.dev/s/generatedcode
4027
- # - `lax`: sources are excluded if they contain lines `autogenerated file`, `code generated`, `do not edit`, etc.
4028
- # - `disable`: disable the generated files exclusion.
4029
- #
4030
- # Default: lax
4031
- exclude-generated : strict
4032
-
4033
- # The list of ids of default excludes to include or disable.
4034
- # https://golangci-lint.run/usage/false-positives/#default-exclusions
4035
- # Default: []
4036
- include :
4037
- - EXC0001
4038
- - EXC0002
4039
- - EXC0003
4040
- - EXC0004
4041
- - EXC0005
4042
- - EXC0006
4043
- - EXC0007
4044
- - EXC0008
4045
- - EXC0009
4046
- - EXC0010
4047
- - EXC0011
4048
- - EXC0012
4049
- - EXC0013
4050
- - EXC0014
4051
- - EXC0015
4052
-
4053
4012
# Maximum issues count per one linter.
4054
4013
# Set to 0 to disable.
4055
4014
# Default: 50
0 commit comments