-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Validate gocritic settings. Return error if settings includes a unsupported gocritic checker #1563
Conversation
Note: I've noticed a separate but related problem: if the input ruleguard rules.go has a syntax error, the error is silently ignored and the entire ruleguard file is ignored. This is unlike the |
@quasilyte, would you be able to review this PR? thank you. |
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.
Looks good.
@ldez , I see you have removed two reviewers. I had added them because they seemed to be the most recent committers for this file. Are you the reviewer? |
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.
From my point of view, it's better to let people add themselves as reviewers if they want to review.
…ported gocritic checker (golangci#1563)
This PR performs additional gocritic settings validation. The
settings
attribute is supposed to be a map where each key is the name of a supported gocritic checker.The existing validation already warns if the config data contains a settings for a disabled checker. But it does not validate the checker is supported. There is also an existing validation that the specific parameter is supported or not.
For example, as shown in the yaml config data below,
ruleguard
is a supported gocritic checker, butrangeValueCopy
is not (the actual checker israngeValCopy
).