From 69837b2a5e8877aeff1d0d4ca47bf7421c41c22c Mon Sep 17 00:00:00 2001 From: Shunpoco Date: Sat, 11 Oct 2025 18:37:29 +0100 Subject: [PATCH] Add tidy into ./x check This commit adds src/tools/tidy into `./x check`. It enables rust-analyzer hightlights errors/warns on all codes in src/tools/tidy. Since tidy is implicitly checked by `./x test tidy`, this new check is off by default. --- src/bootstrap/src/core/build_steps/check.rs | 5 +++++ src/bootstrap/src/core/builder/mod.rs | 1 + 2 files changed, 6 insertions(+) diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs index 400c6f732c3c3..6faa1d018234a 100644 --- a/src/bootstrap/src/core/build_steps/check.rs +++ b/src/bootstrap/src/core/build_steps/check.rs @@ -841,3 +841,8 @@ tool_check_step!(BumpStage0 { mode: Mode::ToolBootstrap, default: false }); + +// Tidy is implicitly checked when `./x test tidy` is executed +// (if you set a pre-push hook, the command is called). +// So this is mainly for people working on tidy. +tool_check_step!(Tidy { path: "src/tools/tidy", mode: Mode::ToolBootstrap, default: false }); diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs index 99fb62ea31c9d..d493f97f307bd 100644 --- a/src/bootstrap/src/core/builder/mod.rs +++ b/src/bootstrap/src/core/builder/mod.rs @@ -1076,6 +1076,7 @@ impl<'a> Builder<'a> { check::CoverageDump, check::Linkchecker, check::BumpStage0, + check::Tidy, // This has special staging logic, it may run on stage 1 while others run on stage 0. // It takes quite some time to build stage 1, so put this at the end. //