Conversation
Just output the results, don't fail on it Removed the rule.exported rule
|
LGTM! |
|
Not sure if this is the right place but I'll try anyway. ;-)
if condition {
return true
}
return falseor 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. |
@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.