-
Notifications
You must be signed in to change notification settings - Fork 97
Run Clippy on CI #2201
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
Closed
Closed
Run Clippy on CI #2201
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I would add
-- -Dwarnings
here -- let me know if that's desiredThere 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.
Unclear if we want to block triagebot CI on clippy. Any opinions @rust-lang/triagebot?
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.
I think I would not like to enforce Clippy in the CI. I gave my option already in #1950, unsure why this work about Clippy linting moved forward.
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.
I personally use
cargo clippy -- -Dwarnings
on many Rust projects, but no strong opinion on having it here. If you two are opposed, I'm fine with not enforcing it.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.
If I may ask, what are you concerns with enforcing clippy lints?
Because clippy lints are generally useful, and I did exactly what you suggested in the issue1: I carefully reviewed the changes, asked for them to split up, vetoed some lints, all of that to improve the quality of the codebase.
Footnotes
https://github.com/rust-lang/triagebot/issues/1950#issuecomment-2820951235 ↩
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.
clippy is a bit of a moving target so linting this codebase moves the requirements for contributors as well. My understanding is that clippy is meant more as a "personal choice" for the developer. We prevent contributors to choose their own style of linting. If there are disagreements on a lint we then would need to add allow/deny directives which (imo) is noise in the code.
For all these reasons I think I don't see many Rust projects enforcing linting besides
rustfmt
but I'd like to hear if there are counterarguments.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.
Not having
-- -Dwarnings
helps with that a bit, as on a new Clippy version, the CI will in the worst case get a couple more warnings, instead of breaking completely.On the other hand, my personal argument for
-- -Dwarnings
is that it much more strongly stops new PRs from introducing additional warnings, requiring every PR to "clean-up" after itself.At least the warn-by-default lints are meant to be fairly uncontroversial -- if there's disagreement about enabling any of those, that could be considered a reason to ask for the lint to be downgraded to allow-by-default.
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.
Personally I'm not a fan of the default clippy set of warnings. The correctness and complexity groups are the only ones that seem relatively safe to enable. perf, style, and suspicious tend to have too many false positives or noise for my taste (or I just disagree with them). There are individual lints that are useful, but the list is so huge that figuring that out is too much of an annoyance for me.
However, I'm not terribly active here, so I don't have a strong say.