-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: syntax to not override severity from linters #4472
Conversation
22c8c3d
to
7a27d49
Compare
Maybe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose @inherit
instead of @
. Or we can use @linter
.
|
Inspire by DNS notation
c1582ec
to
6c033fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
When I created #4452, I thought that only one linter produced issues with severities.
But it's not true as you can see here #4470
The previous option was global: affects all the linters.
The first problem is that
revive
useswarning
anderror
as severity, butgosec
useslow
,medium
, andhigh
.I don't want to convert one to another because:
The second problem is related to the fact that some tools allow only the usage of specific severity.
The current option will keep the severity value from all linters, then the values will be a mix of the different sets.
If you need to use only one set of severities, you need to override/replace the severities from the unsupported set of values.
Then, I reverted the previous PR #4452 (first commit) and replaced it with the usage of a specific wildcard value (
@linter
) as severity.The value@
is inspired by some DNS convention, but we can use another character (*
is ambiguous).This value can be used as a default severity or as a rule severity.
One commit, one change.
The following examples illustrate the behavior.
the code sample
no custom severities
`@linter` as rule severity
`@linter` as default value
Fixes #3111