-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Support -A
, -W
, -D
and -F
when running ./x.py clippy
#97210
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
Rather than special casing these 4 flags, I wonder if it instead makes sense to add I think RUSTFLAGS may already do this? although that breaks a lot of the caching ... I wonder if we should expose RUST_LINT_FLAGS to users. |
Maybe. Personally, I like having it work near the same as regular cargo, hence me making this PR. |
I am actually surprised to see cargo clippy supports passing these directly (cargo build/check/etc do not, today). I think I would prefer the route @jyn514 suggests here over us piping down arguments. The consistency argument is one I do not fully buy into, because we don't generally support every flag on any other Cargo command, and the full spectrum here does not seem significantly different. In general given that Clippy is really only present in x.py for local usage and is not really intended to be well-supported beyond that, I prefer to keep its surface area quite minimal. |
@Mark-Simulacrum cargo-clippy is it's own binary distributed by clippy, it's not part of cargo itself. It has a few inconsistencies like this, another is that the sysroot detection is kind of hacky and occasionally needs help from bootstrap. |
Yeah, I'm aware. I don't think that changes the rest of my perspectives though. |
Ping from triage: @Milo123459 |
hmm, so normally this would be MAGIC_EXTRA_RUSTFLAGS, except that clippy bypasses our shim :/ #97443 (comment) rust/src/bootstrap/bin/rustc.rs Lines 156 to 160 in 471fa05
|
To be honest, I'm not really sure what to do, as Joshua said clippy doesn't work for the hack of directly passing arguments through so I'm not sure. |
@Mark-Simulacrum I think given that the only purpose of x.py clippy is to show warnings, it's reasonable to have the lint flags at the top-level. The other options are
I think A/W/D/F are reasonably low maintenance and consistent with cargo clipppy. |
Okay, I'm not going to block merging this for clippy, but I do want to block any further expansion (i.e., this is not a blessing for it to be carried into check and other modes). Ultimately they are low maintenance, as you say, and consistent with how clippy works elsewhere, even if it's a little unfortunate it's necessary. |
This comment has been minimized.
This comment has been minimized.
Could you please squash the commits? https://rustc-dev-guide.rust-lang.org/git.html has instructions |
Should be all good now |
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.
Sorry for the delay. r=me with the comment addressed.
@bors r+ rollup |
Support `-A`, `-W`, `-D` and `-F` when running `./x.py clippy` Resolves rust-lang#97059 This PR adds support for `-A`, `-W`, `-D` and `-F` when running `./x.py clippy`.
Support `-A`, `-W`, `-D` and `-F` when running `./x.py clippy` Resolves rust-lang#97059 This PR adds support for `-A`, `-W`, `-D` and `-F` when running `./x.py clippy`.
…askrgr Rollup of 8 pull requests Successful merges: - rust-lang#97210 (Support `-A`, `-W`, `-D` and `-F` when running `./x.py clippy`) - rust-lang#99055 (Fix rustdoc help options) - rust-lang#99075 (Fix duplicated type annotation suggestion) - rust-lang#99124 (Fix sized check ICE in asm check) - rust-lang#99142 (fix(doctest): treat fatal parse errors as incomplete attributes) - rust-lang#99145 (Don't rerun the build script for the compiler each time on non-windows platforms) - rust-lang#99146 (Do not error during method probe on `Sized` predicates for types that aren't the method receiver) - rust-lang#99161 (compiletest: trim edition before passing as flag) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Resolves #97059
This PR adds support for
-A
,-W
,-D
and-F
when running./x.py clippy
.