Skip to content

Commit f063933

Browse files
authored
Rollup merge of #70106 - ehuss:fix-tidy-fmt-twice, r=Mark-Simulacrum
Tidy: fix running rustfmt twice `./x.py test tidy` runs rustfmt twice. This is because `Build::build` runs `execute_cli` twice (once dry, once not). This can be quite slow (and prints a bunch of things twice). I'm not sure if this is really the best place to check the dry_run status.
2 parents 2dc0837 + 287c4eb commit f063933

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/bootstrap/format.rs

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ struct RustfmtConfig {
3737
}
3838

3939
pub fn format(build: &Build, check: bool) {
40+
if build.config.dry_run {
41+
return;
42+
}
4043
let mut builder = ignore::types::TypesBuilder::new();
4144
builder.add_defaults();
4245
builder.select("rust");

0 commit comments

Comments
 (0)