Skip to content

Commit

Permalink
Auto merge of rust-lang#107704 - jyn514:tidy-ci, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Run `expand-yaml-anchors` in `x test tidy`

Previously, the pre-commit hook which runs `x test tidy` could pass only to have CI fail within the first 30 seconds. This adds about 30 seconds to `test tidy` (for an initial run, much less after the tool is built the first time) in exchange for catching errors in `.github/workflows/ci.yml` before they're pushed.
  • Loading branch information
bors committed Feb 7, 2023
2 parents dffea43 + 13588cc commit e4dd9ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,9 +1114,6 @@ impl Step for Tidy {
cmd.arg("--bless");
}

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

if builder.config.channel == "dev" || builder.config.channel == "nightly" {
builder.info("fmt check");
if builder.initial_rustfmt().is_none() {
Expand All @@ -1134,6 +1131,11 @@ help: to skip test's attempt to check tidiness, pass `--exclude src/tools/tidy`
}
crate::format::format(&builder, !builder.config.cmd.bless(), &[]);
}

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

builder.ensure(ExpandYamlAnchors {});
}

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/expand-yaml-anchors/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl App {
["generate", ref base] => (Mode::Generate, PathBuf::from(base)),
["check", ref base] => (Mode::Check, PathBuf::from(base)),
_ => {
eprintln!("usage: expand-yaml-anchors <source-dir> <dest-dir>");
eprintln!("usage: expand-yaml-anchors <generate|check> <base-dir>");
std::process::exit(1);
}
};
Expand Down

0 comments on commit e4dd9ed

Please sign in to comment.