about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-04-16 13:45:29 +0200
committerGitHub <noreply@github.com>2025-04-16 13:45:29 +0200
commitb65e6b7c40cc84ed4dc9f338d9afa065155625ed (patch)
tree380b1914dde533bb4d1e484b8bcae4879db544c8 /src/tools
parentf7b6f15298fb5d1dcff3574f21ba085300b8e418 (diff)
parent90aec1367481ab05c78fefad314e03b26e84564f (diff)
downloadrust-b65e6b7c40cc84ed4dc9f338d9afa065155625ed.tar.gz
rust-b65e6b7c40cc84ed4dc9f338d9afa065155625ed.zip
Rollup merge of #139867 - WaffleLapkin:tidypaper, r=jieyouxu
Fix some tidy paper cuts

The main thing this fixes is that currently, if you run `x t tidy` it will format ~6K files, even though it's supposed to format only modified files (whatever this is a useful optimization or not is besides the point). The problem is that `x t tidy` never writes the `rustfmt` stamp, so it always assumes `rustfmt` that was last used is outdated and we need to recheck everything. This PR fixes it by actually writing the stamp.

There are also some minor tweaks to comments/diagnostics. cc ```@Kobzol``` this probably conflicts with #138591. I didn't fix anything, just tried to document better the status quo.

r? ```@jieyouxu```
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/tidy/src/deps.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs
index 88c2a02798a..46e55859a57 100644
--- a/src/tools/tidy/src/deps.rs
+++ b/src/tools/tidy/src/deps.rs
@@ -682,8 +682,10 @@ pub static CRATES: &[&str] = &[
 pub fn has_missing_submodule(root: &Path, submodules: &[&str]) -> bool {
     !CiEnv::is_ci()
         && submodules.iter().any(|submodule| {
+            let path = root.join(submodule);
+            !path.exists()
             // If the directory is empty, we can consider it as an uninitialized submodule.
-            read_dir(root.join(submodule)).unwrap().next().is_none()
+            || read_dir(path).unwrap().next().is_none()
         })
 }