fix(job_queue): Handle Clippy CLI arguments in fix message#16652
Merged
epage merged 2 commits intorust-lang:masterfrom Feb 23, 2026
Merged
fix(job_queue): Handle Clippy CLI arguments in fix message#16652epage merged 2 commits intorust-lang:masterfrom
fix message#16652epage merged 2 commits intorust-lang:masterfrom
Conversation
Collaborator
|
r? @epage rustbot has assigned @epage. Use Why was this reviewer chosen?The reviewer was selected based on:
|
3e2fc30 to
a1de9f6
Compare
epage
reviewed
Feb 18, 2026
epage
reviewed
Feb 18, 2026
epage
reviewed
Feb 18, 2026
epage
reviewed
Feb 18, 2026
Contributor
|
Thanks! |
c2e50aa to
7519507
Compare
a9b2b5c to
1a4e54f
Compare
Collaborator
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Member
Author
|
Sorry for so much force-pushing, but the commit reordering seems to have messed up the git history, so I had to rebase. |
epage
reviewed
Feb 23, 2026
epage
reviewed
Feb 23, 2026
fixes rust-lang#16637 Clippy lints can be enabled via the command line via `cargo clippy -- -Wclippy::lint`, and these need to be included in the `cargo fix` command for the emitting lints to actually be fixed. Thus, add them to the "run `..` to apply .. suggestions" message. Only suggest when running from clippy-driver
1a4e54f to
4e786ef
Compare
epage
approved these changes
Feb 23, 2026
arlosi
added a commit
to arlosi/rust
that referenced
this pull request
Feb 25, 2026
8 commits in 8cc0cb136772b8f54eafe0d163fcb7226a06af0c..f298b8c82da0cba538516b45b04a480fc501d4c0 2026-02-17 12:16:26 +0000 to 2026-02-24 21:59:20 +0000 - fix(host-config): fix panic when cross-compiling with host-config (rust-lang/cargo#16674) - doc: improve documentation on using cfg values with build scripts (rust-lang/cargo#16671) - Fix typo in cargo-yank docs (rust-lang/cargo#16656) - fix(job_queue): Handle Clippy CLI arguments in `fix` message (rust-lang/cargo#16652) - Add a test for fingerprint checking when a symlink target changes (rust-lang/cargo#16661) - Fix parallel locking when `-Zfine-grain-locking` is enabled (rust-lang/cargo#16659) - fix(cli): Remove `--lockfile-path` (rust-lang/cargo#16621) - test(build-std): Update error message (rust-lang/cargo#16658)
rust-bors bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Feb 26, 2026
Update cargo submodule 8 commits in 8cc0cb136772b8f54eafe0d163fcb7226a06af0c..f298b8c82da0cba538516b45b04a480fc501d4c0 2026-02-17 12:16:26 +0000 to 2026-02-24 21:59:20 +0000 - fix(host-config): fix panic when cross-compiling with host-config (rust-lang/cargo#16674) - doc: improve documentation on using cfg values with build scripts (rust-lang/cargo#16671) - Fix typo in cargo-yank docs (rust-lang/cargo#16656) - fix(job_queue): Handle Clippy CLI arguments in `fix` message (rust-lang/cargo#16652) - Add a test for fingerprint checking when a symlink target changes (rust-lang/cargo#16661) - Fix parallel locking when `-Zfine-grain-locking` is enabled (rust-lang/cargo#16659) - fix(cli): Remove `--lockfile-path` (rust-lang/cargo#16621) - test(build-std): Update error message (rust-lang/cargo#16658)
RalfJung
pushed a commit
to RalfJung/miri
that referenced
this pull request
Feb 26, 2026
Update cargo submodule 8 commits in 8cc0cb136772b8f54eafe0d163fcb7226a06af0c..f298b8c82da0cba538516b45b04a480fc501d4c0 2026-02-17 12:16:26 +0000 to 2026-02-24 21:59:20 +0000 - fix(host-config): fix panic when cross-compiling with host-config (rust-lang/cargo#16674) - doc: improve documentation on using cfg values with build scripts (rust-lang/cargo#16671) - Fix typo in cargo-yank docs (rust-lang/cargo#16656) - fix(job_queue): Handle Clippy CLI arguments in `fix` message (rust-lang/cargo#16652) - Add a test for fingerprint checking when a symlink target changes (rust-lang/cargo#16661) - Fix parallel locking when `-Zfine-grain-locking` is enabled (rust-lang/cargo#16659) - fix(cli): Remove `--lockfile-path` (rust-lang/cargo#16621) - test(build-std): Update error message (rust-lang/cargo#16658)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes #16637
What does this PR try to resolve?
Clippy lints can be enabled via the command line via
cargo clippy -- -Wclippy::lint, and these need to be included in thecargo fixcommand (because if a lint is not emitted, it's not fixed, and some lints are allow-by-default)When
cargo clippyis executed, Clippy sets the env. varCLIPPY_ARGSto the arguments that were passed to Clippy, separated by the string__CLIPPY_HACKERY__. To avoid breaking behaviour in between runs (like infix), we should maintain those arguments.This PR takes that
CLIPPY_ARGSenv var (if it exists), replaces the__CLIPPY_HACKERY__separator and appends it to the suggestedcargo clippy --fixcommand when emitting fixable warnings.How to test and review this PR?
Via copying a crate (in my case,
tokio-1.38.1) and executing the following commands:rustup run nightly ~/git/cargo/target/debug/cargo clippy -- -Wclippy::pedantic -Aclippy::allow_attributes -Wclippy::dbg_macro -Wclippy::eq_opIn order to get some warnings. If any fixable warning is emitted, the output message should end with:
Now, testing with the suggested command (in this case, also with the version pinned @1.38.1):
rustup run nightly ~/git/cargo/target/debug/cargo clippy --fix --lib -p tokio@1.38.1 -- -Wclippy::pedantic -Aclippy::allow_attributes -Wclippy::dbg_macro -Wclippy::eq_opAll warnings (including those allow-by-default
pedanticlints!) should be fixed now.