-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Enable previously disabled revive (lint) rules and fix up code #13068
Conversation
174e1f5
to
d5ab8a3
Compare
d5ab8a3
to
1e6e71b
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.
Thanks for this.
Couple of suggestions, plus notes to help the next reviewer.
@@ -72,7 +72,7 @@ func WithFunctions(functions map[string]*Function) Opt { | |||
} | |||
|
|||
// NewParser returns a new parser. | |||
func NewParser(input string, opts ...Opt) *parser { | |||
func NewParser(input string, opts ...Opt) *parser { //nolint:revive // unexported-return. |
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.
Guessing this is exported for users outside of Prometheus?
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.
Yep.
I would like to bump the priority of this, since If you can rebase and/or address any of the review comments please do; in the meantime I'll start addressing a couple of them myself. |
78cc3ea
to
cb33b45
Compare
@bboreham I fixed most of the comments. Please re-review. |
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
cb33b45
to
5a1d95b
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.
Thanks, I guess I can close my PRs now.
This PR enables
revive
linter default rules that were implicitly disabled in #12197. Also, the PR fixesrevive
lint issues.Explanation
By design, if no particular configuration is provided,
revive
will behave asgolint
does, i.e. allgolint
rules are enabled (see this default.toml). But when a configuration is provided, only rules in the configuration are enabled (see revive's doc). That's why, when PR #12197 disablesunused-parameter
in the configuration, it actually disables the whole default ruleset.Thanks to @bboreham for pointing out revive's configuration issue here
Additional Logs
Below is the full list of
revive
issues that were disabled or fixed: