about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-02-07 09:58:58 +0000
committerbors <bors@rust-lang.org>2023-02-07 09:58:58 +0000
commite4dd9edb76a34ecbca539967f9662b8c0cc9c7fb (patch)
treebab0dcab286009c42480c640817ff7c32ca6800c
parentdffea43fc1102bdfe16d88ed412c23d4f0f08d9d (diff)
parent13588cc681c9cc451ddf6286424b1a611cc1277a (diff)
downloadrust-e4dd9edb76a34ecbca539967f9662b8c0cc9c7fb.tar.gz
rust-e4dd9edb76a34ecbca539967f9662b8c0cc9c7fb.zip
Auto merge of #107704 - jyn514:tidy-ci, r=Mark-Simulacrum
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.
-rw-r--r--src/bootstrap/test.rs8
-rw-r--r--src/tools/expand-yaml-anchors/src/main.rs2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 6078e39ac9d..8a0c532cfb0 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -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() {
@@ -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<'_> {
diff --git a/src/tools/expand-yaml-anchors/src/main.rs b/src/tools/expand-yaml-anchors/src/main.rs
index 8992d165d5d..3fc72ecbbc4 100644
--- a/src/tools/expand-yaml-anchors/src/main.rs
+++ b/src/tools/expand-yaml-anchors/src/main.rs
@@ -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);
             }
         };