Skip to content

Commit

Permalink
Rollup merge of rust-lang#70106 - ehuss:fix-tidy-fmt-twice, r=Mark-Si…
Browse files Browse the repository at this point in the history
…mulacrum

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.
  • Loading branch information
Centril authored Mar 18, 2020
2 parents 60a2d06 + 287c4eb commit b6f61a1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bootstrap/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ struct RustfmtConfig {
}

pub fn format(build: &Build, check: bool) {
if build.config.dry_run {
return;
}
let mut builder = ignore::types::TypesBuilder::new();
builder.add_defaults();
builder.select("rust");
Expand Down

0 comments on commit b6f61a1

Please sign in to comment.