Skip to content

Commit 5fdc8eb

Browse files
authored
Rollup merge of rust-lang#88511 - matthiaskrgr:xpyclippydefaulttarget, r=jyn514
x.py clippy: don't run with --all-targets by default this caused a lot of noise because benchmarks and tests were also checked before: `./x.py clippy |& wc -l` `74026` with change: `./x.py clippy |& wc -l` `43269` Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/x.2Epy.20check.20default.20targets r? `@jyn514` or `@Mark-Simulacrum`
2 parents 22dd6a4 + 5538be5 commit 5fdc8eb

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/bootstrap/check.rs

+18-2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ impl Step for Std {
107107
add_to_sysroot(&builder, &libdir, &hostdir, &libstd_stamp(builder, compiler, target));
108108
}
109109

110+
// don't run on std twice with x.py clippy
111+
if builder.kind == Kind::Clippy {
112+
return;
113+
}
114+
110115
// Then run cargo again, once we've put the rmeta files for the library
111116
// crates into the sysroot. This is needed because e.g., core's tests
112117
// depend on `libtest` -- Cargo presumes it will exist, but it doesn't
@@ -120,6 +125,7 @@ impl Step for Std {
120125
target,
121126
cargo_subcommand(builder.kind),
122127
);
128+
123129
cargo.arg("--all-targets");
124130
std_cargo(builder, target, compiler.stage, &mut cargo);
125131

@@ -192,7 +198,12 @@ impl Step for Rustc {
192198
cargo_subcommand(builder.kind),
193199
);
194200
rustc_cargo(builder, &mut cargo, target);
195-
cargo.arg("--all-targets");
201+
202+
// For ./x.py clippy, don't run with --all-targets because
203+
// linting tests and benchmarks can produce very noisy results
204+
if builder.kind != Kind::Clippy {
205+
cargo.arg("--all-targets");
206+
}
196207

197208
// Explicitly pass -p for all compiler krates -- this will force cargo
198209
// to also check the tests/benches/examples for these crates, rather
@@ -313,7 +324,12 @@ macro_rules! tool_check_step {
313324
$source_type,
314325
&[],
315326
);
316-
cargo.arg("--all-targets");
327+
328+
// For ./x.py clippy, don't run with --all-targets because
329+
// linting tests and benchmarks can produce very noisy results
330+
if builder.kind != Kind::Clippy {
331+
cargo.arg("--all-targets");
332+
}
317333

318334
// Enable internal lints for clippy and rustdoc
319335
// NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![warn(rustc::internal)]`

0 commit comments

Comments
 (0)