-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Run revive linter in CI #8798
Run revive linter in CI #8798
Conversation
Just output the results, don't fail on it Removed the rule.exported rule
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.
🤝 ✅ CLA has been signed. Thank you!
LGTM! |
Not sure if this is the right place but I'll try anyway. ;-)
if condition {
return true
}
return false or the inverse can be simplified to |
@srebhan (and @ssoroka, @reimda): Unfortunately it seems that to add own rule, accepted PR to https://github.com/mgechev/revive or fork is needed: https://github.com/mgechev/revive#extensibility |
@zak-pawel that is an unfortunate limitation, maybe we should use golangci-lint for now which would let us create a Telegraf specific linter without having to push it upstream (more info). I can just update this PR to change from revive->golangci-lint. |
I think that we can start with revive (as wew did :)) - because it is pretty good tool. We will try to fix as many problems as possible and after that (or in parallel) we can start to work with golangci-lint also. |
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.
Perfect thanks!
@srebhan we can cover these in the future, they should not be part of this PR :) |
@p-zak I fully agree. |
@sspaink Don't we need to wait for next release (> v1.36.0) of golangci-lint to contain |
And v1.37.0 has been just released :) |
* Run revive linter in CI Just output the results, don't fail on it Removed the rule.exported rule * Move revive install to CI * new line * Use golangci-lint * Get v1.37 * increase timeout by a minute * try five minutes * newline missing * Update config
Run the revive linter for each pull request, but don't fail on it just output the results in a friendly format. Added a config toml with the rule "exported" removed that had 2K issues reported for things exported without a comment.
Once the errors are more cleaned up, this should be updated to warn/error if a pull request introduces issues. Related to the pr #8797.