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
Global severity setting has no effect if enableAllRules
is true
#577
Comments
apparently setting |
This issue is actually a bit deeper... with the following config
and the following command.
you will never see error severity raised for any of the rules.
To fix this issue, it might require appending entries for each missing rule to the config before the call to normalizeConfig |
Hi @rustysys-dev, thanks for filling the issue.
Confidence does something:
With a config file:
with I'll check for |
Testing
Results in:
After setting
That seems a correct behavior of the |
Keeping open until we hear back from @rustysys-dev |
@mgechev Thank you for keeping the issue open. I just tried it on my end, and I am still not getting results. The configuration given above works on my end.... Working config
Working config output
Non-working config
Non-working config output
the only difference being that in the one that doesn't work I also tried the following configuration where I define
and strangely enough this worked too... so the bug might be that if all rules are enabled, but seems like only explicitly defined rules are able to cause an error result. Speaking of which I have problem context question. How is global severity defined when it doesn't have a tag to parse it into the struct as shown here? |
Thanks @rustysys-dev I'll check the cases you describe.
These annotations are not necessary if struct's field names match (case-insensitively) with the fields in the toml file. |
enableAllRules
is true
Thank you! that makes sense... and now that you say it I do remember hearing about that before... I am just used to seeing everything defined explicitly. Feel a bit stupid now 😂 Also I checked out your PR and tried it for my use case and it looks good! |
Describe the bug
Due to the code not having flags for parsing the global severity setting from toml, its not possible to globally set the severity.
https://github.com/mgechev/revive/blame/d7e3d5eac7453bfbb4c5d02e612459f91024427f/lint/config.go#L28
Proposed fix is to add the toml tag for severity here.
The text was updated successfully, but these errors were encountered: