Skip to content

Commit 2b081ab

Browse files
anpMark-Simulacrum
authored andcommitted
Include formatting check in the test step for tidy.
1 parent 5f17b63 commit 2b081ab

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/bootstrap/test.rs

+8
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,9 @@ impl Step for Tidy {
779779
/// This tool in `src/tools` checks up on various bits and pieces of style and
780780
/// otherwise just implements a few lint-like checks that are specific to the
781781
/// compiler itself.
782+
///
783+
/// Once tidy passes, this step also runs `fmt --check` if tests are being run
784+
/// for the `dev` or `nightly` channels.
782785
fn run(self, builder: &Builder<'_>) {
783786
let mut cmd = builder.tool_cmd(Tool::Tidy);
784787
cmd.arg(builder.src.join("src"));
@@ -792,6 +795,11 @@ impl Step for Tidy {
792795

793796
builder.info("tidy check");
794797
try_run(builder, &mut cmd);
798+
799+
if builder.config.channel == "dev" || builder.config.channel == "nightly" {
800+
builder.info("fmt check");
801+
crate::format::format(&builder.build, true);
802+
}
795803
}
796804

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

0 commit comments

Comments
 (0)