Skip to content

Commit

Permalink
Include formatting check in the test step for tidy.
Browse files Browse the repository at this point in the history
  • Loading branch information
anp authored and Mark-Simulacrum committed Dec 22, 2019
1 parent 5f17b63 commit 2b081ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/bootstrap/test.rs
Expand Up @@ -779,6 +779,9 @@ impl Step for Tidy {
/// This tool in `src/tools` checks up on various bits and pieces of style and
/// otherwise just implements a few lint-like checks that are specific to the
/// compiler itself.
///
/// Once tidy passes, this step also runs `fmt --check` if tests are being run
/// for the `dev` or `nightly` channels.
fn run(self, builder: &Builder<'_>) {
let mut cmd = builder.tool_cmd(Tool::Tidy);
cmd.arg(builder.src.join("src"));
Expand All @@ -792,6 +795,11 @@ impl Step for Tidy {

builder.info("tidy check");
try_run(builder, &mut cmd);

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

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
Expand Down

0 comments on commit 2b081ab

Please sign in to comment.