Skip to content

Commit 48ae7ec

Browse files
committed
Adress review comments
1 parent fc00cdc commit 48ae7ec

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

lintcheck/src/config.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub(crate) struct LintcheckConfig {
1313
value_name = "N",
1414
default_value_t = 0,
1515
default_value_if("perf", "true", Some("1")), // Limit jobs to 1 when benchmarking
16+
conflicts_with("perf"),
1617
required = false,
1718
hide_default_value = true
1819
)]

lintcheck/src/main.rs

+15-19
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ impl Crate {
131131
"--",
132132
"cargo",
133133
]);
134-
cmd.env("CARGO_PROFILE_RELEASE_DEBUG", "true");
135134
} else {
136135
cmd = Command::new("cargo");
137136
}
@@ -254,17 +253,21 @@ fn normalize_diag(
254253

255254
/// Builds clippy inside the repo to make sure we have a clippy executable we can use.
256255
fn build_clippy(release_build: bool) -> String {
257-
let output = Command::new("cargo")
258-
.args([
259-
"run",
260-
"--bin=clippy-driver",
261-
if release_build { "-r" } else { "" },
262-
"--",
263-
"--version",
264-
])
265-
.stderr(Stdio::inherit())
266-
.output()
267-
.unwrap();
256+
let mut build_cmd = Command::new("cargo");
257+
build_cmd.args([
258+
"run",
259+
"--bin=clippy-driver",
260+
if release_build { "-r" } else { "" },
261+
"--",
262+
"--version",
263+
]);
264+
265+
if release_build {
266+
build_cmd.env("CARGO_PROFILE_RELEASE_DEBUG", "true");
267+
}
268+
269+
let output = build_cmd.stderr(Stdio::inherit()).output().unwrap();
270+
268271
if !output.status.success() {
269272
eprintln!("Error: Failed to compile Clippy!");
270273
std::process::exit(1);
@@ -286,13 +289,6 @@ fn main() {
286289

287290
let config = LintcheckConfig::new();
288291

289-
if config.perf && config.max_jobs != 1 {
290-
eprintln!(
291-
"Lintcheck's --perf flag must be triggered only with 1 job,\nremove either the --jobs/-j flag or the --perf flag"
292-
);
293-
return;
294-
}
295-
296292
match config.subcommand {
297293
Some(Commands::Diff { old, new, truncate }) => json::diff(&old, &new, truncate),
298294
Some(Commands::Popular { output, number }) => popular_crates::fetch(output, number).unwrap(),

0 commit comments

Comments
 (0)