-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: remove v1 exclusion configuration #5451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
c704960
ee3af9f
b574814
5108d71
e01da53
3214cac
e401b34
7b39825
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -261,6 +261,78 @@ linters: | |||||||||||||||||
# Default: false | ||||||||||||||||||
fast: true | ||||||||||||||||||
|
||||||||||||||||||
# Defines a set of rules to ignore issues. | ||||||||||||||||||
# It does not skip the analysis, and so don't ignore "typecheck" errors. | ||||||||||||||||||
exclusions: | ||||||||||||||||||
# Mode of the generated files analysis. | ||||||||||||||||||
# | ||||||||||||||||||
# - `strict`: sources are excluded by following strictly the Go generated file convention. | ||||||||||||||||||
ldez marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
# Source files that have lines matching only the following regular expression will be excluded: `^// Code generated .* DO NOT EDIT\.$` | ||||||||||||||||||
# This line must appear before the first non-comment, non-blank text in the file. | ||||||||||||||||||
# https://go.dev/s/generatedcode | ||||||||||||||||||
# - `lax`: sources are excluded if they contain lines `autogenerated file`, `code generated`, `do not edit`, etc. | ||||||||||||||||||
ldez marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
# - `disable`: disable the generated files exclusion. | ||||||||||||||||||
# | ||||||||||||||||||
# Default: lax | ||||||||||||||||||
generated: strict | ||||||||||||||||||
# Log a warning if an exclusion rule is unused. | ||||||||||||||||||
# Default: false | ||||||||||||||||||
warn-unused: true | ||||||||||||||||||
# Predefined exclusion rules. | ||||||||||||||||||
# Default: [] | ||||||||||||||||||
presets: | ||||||||||||||||||
- comments | ||||||||||||||||||
- stdErrorHandling | ||||||||||||||||||
- commonFalsePositives | ||||||||||||||||||
- legacy | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe better is to use
Suggested change
Or make preset names shorter with an extended description. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer to use camelCase because these are not field names. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I can vote, I vote to use kebab-case for human readable names. camelCase lacks the space usually seen in text and feels more aimed towards computers, similar with snake_case and underscore. I know these are values and not keys, but we do use kebab-case in general in the config (e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will change the values but we agree those values have been documented inside the proposal and introduced by another PR. This PR is just adding them to the documentation. My remark about human-readable names was related to the idea "make preset names shorter with an extended description", because I want to avoid the previous "short but unusable without the doc" names. |
||||||||||||||||||
|
||||||||||||||||||
# Excluding configuration per-path, per-linter, per-text and per-source. | ||||||||||||||||||
rules: | ||||||||||||||||||
# Exclude some linters from running on tests files. | ||||||||||||||||||
- path: _test\.go | ||||||||||||||||||
linters: | ||||||||||||||||||
- gocyclo | ||||||||||||||||||
- errcheck | ||||||||||||||||||
- dupl | ||||||||||||||||||
- gosec | ||||||||||||||||||
|
||||||||||||||||||
# Run some linter only for test files by excluding its issues for everything else. | ||||||||||||||||||
- path-except: _test\.go | ||||||||||||||||||
linters: | ||||||||||||||||||
- forbidigo | ||||||||||||||||||
|
||||||||||||||||||
# Exclude known linters from partially hard-vendored code, | ||||||||||||||||||
# which is impossible to exclude via `nolint` comments. | ||||||||||||||||||
# `/` will be replaced by current OS file path separator to properly work on Windows. | ||||||||||||||||||
ldez marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
- path: internal/hmac/ | ||||||||||||||||||
text: "weak cryptographic primitive" | ||||||||||||||||||
linters: | ||||||||||||||||||
- gosec | ||||||||||||||||||
|
||||||||||||||||||
# Exclude some `staticcheck` messages. | ||||||||||||||||||
- linters: | ||||||||||||||||||
- staticcheck | ||||||||||||||||||
text: "SA9003:" | ||||||||||||||||||
|
||||||||||||||||||
# Exclude `lll` issues for long lines with `go:generate`. | ||||||||||||||||||
- linters: | ||||||||||||||||||
- lll | ||||||||||||||||||
source: "^//go:generate " | ||||||||||||||||||
|
||||||||||||||||||
# Which file paths to exclude: they will be analyzed, but issues from them won't be reported. | ||||||||||||||||||
# There is no need to include all autogenerated files, | ||||||||||||||||||
# we confidently recognize autogenerated files. | ||||||||||||||||||
# If it's not, please let us know. | ||||||||||||||||||
ldez marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
# "/" will be replaced by current OS file path separator to properly work on Windows. | ||||||||||||||||||
ldez marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
# Default: [] | ||||||||||||||||||
paths: | ||||||||||||||||||
- ".*\\.my\\.go$" | ||||||||||||||||||
- lib/bad.go | ||||||||||||||||||
# Which file paths to not exclude. | ||||||||||||||||||
# Default: [] | ||||||||||||||||||
paths-except: | ||||||||||||||||||
- ".*\\.my\\.go$" | ||||||||||||||||||
- lib/bad.go | ||||||||||||||||||
|
||||||||||||||||||
formatters: | ||||||||||||||||||
# Enable specific formatter. | ||||||||||||||||||
|
@@ -3940,116 +4012,6 @@ linters-settings: | |||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
issues: | ||||||||||||||||||
# List of regexps of issue texts to exclude. | ||||||||||||||||||
# | ||||||||||||||||||
# But independently of this option we use default exclude patterns, | ||||||||||||||||||
# it can be disabled by `exclude-use-default: false`. | ||||||||||||||||||
# To list all excluded by default patterns execute `golangci-lint run --help` | ||||||||||||||||||
# | ||||||||||||||||||
# Default: https://golangci-lint.run/usage/false-positives/#default-exclusions | ||||||||||||||||||
exclude: | ||||||||||||||||||
- abcdef | ||||||||||||||||||
|
||||||||||||||||||
# Excluding configuration per-path, per-linter, per-text and per-source | ||||||||||||||||||
exclude-rules: | ||||||||||||||||||
# Exclude some linters from running on tests files. | ||||||||||||||||||
- path: _test\.go | ||||||||||||||||||
linters: | ||||||||||||||||||
- gocyclo | ||||||||||||||||||
- errcheck | ||||||||||||||||||
- dupl | ||||||||||||||||||
- gosec | ||||||||||||||||||
|
||||||||||||||||||
# Run some linter only for test files by excluding its issues for everything else. | ||||||||||||||||||
- path-except: _test\.go | ||||||||||||||||||
linters: | ||||||||||||||||||
- forbidigo | ||||||||||||||||||
|
||||||||||||||||||
# Exclude known linters from partially hard-vendored code, | ||||||||||||||||||
# which is impossible to exclude via `nolint` comments. | ||||||||||||||||||
# `/` will be replaced by current OS file path separator to properly work on Windows. | ||||||||||||||||||
- path: internal/hmac/ | ||||||||||||||||||
text: "weak cryptographic primitive" | ||||||||||||||||||
linters: | ||||||||||||||||||
- gosec | ||||||||||||||||||
|
||||||||||||||||||
# Exclude some `staticcheck` messages. | ||||||||||||||||||
- linters: | ||||||||||||||||||
- staticcheck | ||||||||||||||||||
text: "SA9003:" | ||||||||||||||||||
|
||||||||||||||||||
# Exclude `lll` issues for long lines with `go:generate`. | ||||||||||||||||||
- linters: | ||||||||||||||||||
- lll | ||||||||||||||||||
source: "^//go:generate " | ||||||||||||||||||
|
||||||||||||||||||
# Independently of option `exclude` we use default exclude patterns, | ||||||||||||||||||
# it can be disabled by this option. | ||||||||||||||||||
# To list all excluded by default patterns execute `golangci-lint run --help`. | ||||||||||||||||||
# Default: true | ||||||||||||||||||
exclude-use-default: false | ||||||||||||||||||
|
||||||||||||||||||
# If set to true, `exclude` and `exclude-rules` regular expressions become case-sensitive. | ||||||||||||||||||
# Default: false | ||||||||||||||||||
exclude-case-sensitive: false | ||||||||||||||||||
|
||||||||||||||||||
# Which dirs to exclude: issues from them won't be reported. | ||||||||||||||||||
# Can use regexp here: `generated.*`, regexp is applied on full path, | ||||||||||||||||||
# including the path prefix if one is set. | ||||||||||||||||||
# Default dirs are skipped independently of this option's value (see exclude-dirs-use-default). | ||||||||||||||||||
# "/" will be replaced by current OS file path separator to properly work on Windows. | ||||||||||||||||||
# Default: [] | ||||||||||||||||||
exclude-dirs: | ||||||||||||||||||
- src/external_libs | ||||||||||||||||||
- autogenerated_by_my_lib | ||||||||||||||||||
|
||||||||||||||||||
# Enables exclude of directories: | ||||||||||||||||||
# - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ | ||||||||||||||||||
# Default: true | ||||||||||||||||||
exclude-dirs-use-default: false | ||||||||||||||||||
|
||||||||||||||||||
# Which files to exclude: they will be analyzed, but issues from them won't be reported. | ||||||||||||||||||
# There is no need to include all autogenerated files, | ||||||||||||||||||
# we confidently recognize autogenerated files. | ||||||||||||||||||
# If it's not, please let us know. | ||||||||||||||||||
# "/" will be replaced by current OS file path separator to properly work on Windows. | ||||||||||||||||||
# Default: [] | ||||||||||||||||||
exclude-files: | ||||||||||||||||||
- ".*\\.my\\.go$" | ||||||||||||||||||
- lib/bad.go | ||||||||||||||||||
|
||||||||||||||||||
# Mode of the generated files analysis. | ||||||||||||||||||
# | ||||||||||||||||||
# - `strict`: sources are excluded by following strictly the Go generated file convention. | ||||||||||||||||||
# Source files that have lines matching only the following regular expression will be excluded: `^// Code generated .* DO NOT EDIT\.$` | ||||||||||||||||||
# This line must appear before the first non-comment, non-blank text in the file. | ||||||||||||||||||
# https://go.dev/s/generatedcode | ||||||||||||||||||
# - `lax`: sources are excluded if they contain lines `autogenerated file`, `code generated`, `do not edit`, etc. | ||||||||||||||||||
# - `disable`: disable the generated files exclusion. | ||||||||||||||||||
# | ||||||||||||||||||
# Default: lax | ||||||||||||||||||
exclude-generated: strict | ||||||||||||||||||
|
||||||||||||||||||
# The list of ids of default excludes to include or disable. | ||||||||||||||||||
# https://golangci-lint.run/usage/false-positives/#default-exclusions | ||||||||||||||||||
# Default: [] | ||||||||||||||||||
include: | ||||||||||||||||||
- EXC0001 | ||||||||||||||||||
- EXC0002 | ||||||||||||||||||
- EXC0003 | ||||||||||||||||||
- EXC0004 | ||||||||||||||||||
- EXC0005 | ||||||||||||||||||
- EXC0006 | ||||||||||||||||||
- EXC0007 | ||||||||||||||||||
- EXC0008 | ||||||||||||||||||
- EXC0009 | ||||||||||||||||||
- EXC0010 | ||||||||||||||||||
- EXC0011 | ||||||||||||||||||
- EXC0012 | ||||||||||||||||||
- EXC0013 | ||||||||||||||||||
- EXC0014 | ||||||||||||||||||
- EXC0015 | ||||||||||||||||||
|
||||||||||||||||||
# Maximum issues count per one linter. | ||||||||||||||||||
# Set to 0 to disable. | ||||||||||||||||||
# Default: 50 | ||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.