Skip to content

Commit

Permalink
Rollup merge of rust-lang#67701 - petrochenkov:tidybless, r=Mark-Simu…
Browse files Browse the repository at this point in the history
…lacrum

tidy: Enforce formatting rather than just check it if `--bless` is specified

Ensuring the "tidy"-ness currently requires running `rustfmt` twice:
```sh
./x.py fmt && ./x.py test tidy
```
, once to actually format code and the second time as a part of tidy to check that the code is formatted.

Running `rustfmt` is slow, so we don't want to run it twice.

With this PR tidy enforces the formatting rather than just checks it if `--bless` was passed to it:
```sh
./x.py test tidy --bless
```

r? @Mark-Simulacrum
  • Loading branch information
JohnTitor authored Dec 30, 2019
2 parents 88e322c + 5b80a99 commit b6244af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ impl Step for Tidy {

if builder.config.channel == "dev" || builder.config.channel == "nightly" {
builder.info("fmt check");
crate::format::format(&builder.build, true);
crate::format::format(&builder.build, !builder.config.cmd.bless());
}
}

Expand Down

0 comments on commit b6244af

Please sign in to comment.