forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
cargo dev lint
to manually run clippy on a file
I found the manual run command really useful, this makes it a bit easier to type
- Loading branch information
Showing
4 changed files
with
36 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use std::process::{self, Command}; | ||
|
||
pub fn run(filename: &str) { | ||
let code = Command::new("cargo") | ||
.args(["run", "--bin", "clippy-driver", "--"]) | ||
.args(["-L", "./target/debug"]) | ||
.args(["-Z", "no-codegen"]) | ||
.args(["--edition", "2021"]) | ||
.arg(filename) | ||
.env("__CLIPPY_INTERNAL_TESTS", "true") | ||
.status() | ||
.expect("failed to run cargo") | ||
.code(); | ||
|
||
if code.is_none() { | ||
eprintln!("Killed by signal"); | ||
} | ||
|
||
process::exit(code.unwrap_or(1)); | ||
} |
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