forked from rust-lang/rust-clippy
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdogfood.rs
31 lines (24 loc) · 777 Bytes
/
dogfood.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use crate::utils::{clippy_project_root, exit_if_err};
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", "--nocapture"]);
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(" "));
exit_if_err(cmd.status());
}