-
Notifications
You must be signed in to change notification settings - Fork 69
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
Start using clippy on rustc #709
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed. Concerns or objections to the proposal should be discussed on Zulip and formally registered here by adding a comment with the following syntax:
Concerns can be lifted with:
See documentation at https://forge.rust-lang.org cc @rust-lang/compiler @rust-lang/compiler-contributors |
🙌 @rustbot second i'm very in favor of allowing a limited amount of clippy lints to be enforced in the compiler |
I've been applying a lot of clippy fixes to the codebase in the past years and I would say the most interesting lint groups for rustc are There are a lot of Some general questions: How do we want to control the set of lints that we apply on rustc? How do we handle subtrees like rustfmt or rust-analyzer which are checked by I don't think that a clippy update should be blocked by new TPs/FPs in clippy showing up in rustcs codebase, what will be the to-go way in such cases (allow the entire lint, throw some allow attrs into the relevant places..?) |
@matthiaskrgr: Do you mind copying all those questions over to the zulip thread so that we can discuss them in detail? |
@rustbot label -final-comment-period +major-change-accepted |
This has been closed. What's the status?
|
It has been closed because the proposal has been accepted. @Kobzol is working on implementing it. |
Fix `clippy::correctness` in the library needs rust-lang/backtrace-rs#579 to be complete for rust-lang/compiler-team#709
Rollup merge of rust-lang#119449 - Nilstrieb:library-clippy, r=cuviper Fix `clippy::correctness` in the library needs rust-lang/backtrace-rs#579 to be complete for rust-lang/compiler-team#709
…crum Gate PR CI on clippy correctness lints Implements part of rust-lang/compiler-team#709. Note that `x.py clippy compiler` also checks the standard library, because it needs to be checked before the compiler. This happens even with `x.py clippy --stage 0`.
…crum Gate PR CI on clippy correctness lints Implements part of rust-lang/compiler-team#709. Note that `x.py clippy compiler` also checks the standard library, because it needs to be checked before the compiler. This happens even with `x.py clippy --stage 0`.
Rollup merge of rust-lang#119451 - Kobzol:ci-pr-clippy, r=Mark-Simulacrum Gate PR CI on clippy correctness lints Implements part of rust-lang/compiler-team#709. Note that `x.py clippy compiler` also checks the standard library, because it needs to be checked before the compiler. This happens even with `x.py clippy --stage 0`.
Gate PR CI on clippy correctness lints Implements part of rust-lang/compiler-team#709. Note that `x.py clippy compiler` also checks the standard library, because it needs to be checked before the compiler. This happens even with `x.py clippy --stage 0`.
Fix `clippy::correctness` in the library needs rust-lang/backtrace-rs#579 to be complete for rust-lang/compiler-team#709
Fix `clippy::correctness` in the library needs rust-lang/backtrace-rs#579 to be complete for rust-lang/compiler-team#709
Proposal
Thanks to the amazing work T-bootstrap, clippy now works properly in rust-lang/rust! This is great, we should start using it.
We should enforce clippy in CI with
-Aclippy::all -Dclippy::correctness
. This ensures that there is not much effort and has the highest value. This finds real bugs, like rust-lang/rust#119447.Running it locally doesn't show too many lints, mostly problems with
clippy::unused_io_amount
on slices (these should just useread_exact
and some issues around bitflags (which should be resolved with the upgrade)). Fixing all of this is not too much effort and high value.clippy::all
has hundreds of warnings and it's not realistic to enforce this any time soon. It's also unclear whether we ever want that, and I would very much prefer not bikeshedding that right now, let's focus onclippy::correctness
. Meanwhile, we're still happy to take fixes forclippy::all
lints as long as they aren't too much of a burden to review.cc @flip1995, this could cause some trouble on syncs if clippy ships new correctness lints that fire and we use in-tree clippy instead of beta clippy.
Mentors or Reviewers
anyone
Process
The main points of the Major Change Process are as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.
The text was updated successfully, but these errors were encountered: