1 use crate::clippy_project_root;
2 use std::process::Command;
6 /// Panics if unable to run the dogfood test
7 pub fn dogfood(fix: bool, allow_dirty: bool, allow_staged: bool) {
8 let mut cmd = Command::new("cargo");
10 cmd.current_dir(clippy_project_root())
11 .args(["test", "--test", "dogfood"])
12 .args(["--features", "internal"])
13 .args(["--", "dogfood_clippy"]);
15 let mut dogfood_args = Vec::new();
17 dogfood_args.push("--fix");
21 dogfood_args.push("--allow-dirty");
25 dogfood_args.push("--allow-staged");
28 cmd.env("__CLIPPY_DOGFOOD_ARGS", dogfood_args.join(" "));
30 let output = cmd.output().expect("failed to run command");
32 println!("{}", String::from_utf8_lossy(&output.stdout));