-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #11399 - Muscraft:autofix-for-clippy, r=weihanglo
fix: Make auto-fix note work with `clippy` [Someone pointed out](#10976 (comment)) that the suggestion to run `cargo --fix` did not work properly for `cargo clippy`. This makes sure the correct command to run is output when running under `cargo clippy`. This is done by checking if the `RUSTC_WORKSPACE_WRAPPER` environment variable is set, since `clippy` [sets this every run](https://github.com/rust-lang/rust-clippy/blob/51ec465cc3dfb62a2dad7e808b399fa76a1c9170/src/main.rs#L140). Since other things can use `RUSTC_WORKSPACE_WRAPPER`, we look for a wrapper named [`clippy-driver`](https://github.com/rust-lang/rust-clippy/blob/51ec465cc3dfb62a2dad7e808b399fa76a1c9170/src/main.rs#L120). Since `clippy` might not be available everywhere `cargo` is tested, this is tested using a `rustc` wrapper.
- Loading branch information
Showing
2 changed files
with
71 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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 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