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.
Auto merge of rust-lang#9039 - Serial-ATA:dev-dogfood, r=giraffate
Add `cargo dev dogfood` changelog: Add `cargo dev dogfood` Part of rust-lang#5394
- Loading branch information
Showing
5 changed files
with
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use crate::clippy_project_root; | ||
use std::process::Command; | ||
|
||
/// # Panics | ||
/// | ||
/// Panics if unable to run the dogfood test | ||
pub fn dogfood(fix: bool, allow_dirty: bool, allow_staged: bool) { | ||
let mut cmd = Command::new("cargo"); | ||
|
||
cmd.current_dir(clippy_project_root()) | ||
.args(["test", "--test", "dogfood"]) | ||
.args(["--features", "internal"]) | ||
.args(["--", "dogfood_clippy"]); | ||
|
||
let mut dogfood_args = Vec::new(); | ||
if fix { | ||
dogfood_args.push("--fix"); | ||
} | ||
|
||
if allow_dirty { | ||
dogfood_args.push("--allow-dirty"); | ||
} | ||
|
||
if allow_staged { | ||
dogfood_args.push("--allow-staged"); | ||
} | ||
|
||
cmd.env("__CLIPPY_DOGFOOD_ARGS", dogfood_args.join(" ")); | ||
|
||
let output = cmd.output().expect("failed to run command"); | ||
|
||
println!("{}", String::from_utf8_lossy(&output.stdout)); | ||
} |
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
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