about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-06-22 12:56:24 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-06-24 11:10:18 +0200
commit4e258bb4c30a76917e812adb111bfb9ddb68a5b9 (patch)
tree86264e3df41af4884a351fc9a37cd880ebda41cc
parent51fedf65ffa8b6d8c84144d85c0d5e2fce871359 (diff)
downloadrust-4e258bb4c30a76917e812adb111bfb9ddb68a5b9.tar.gz
rust-4e258bb4c30a76917e812adb111bfb9ddb68a5b9.zip
Fix tidy issue for rustdoc tests commands
-rw-r--r--src/tools/tidy/src/style.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs
index 7bcb85335e0..e4d54d2a2b5 100644
--- a/src/tools/tidy/src/style.rs
+++ b/src/tools/tidy/src/style.rs
@@ -186,6 +186,11 @@ fn should_ignore(line: &str) -> bool {
     // - `//@[rev] normalize-stderr-test`
         || static_regex!("\\s*//@(\\[.*\\]) (compile-flags|normalize-stderr-test|error-pattern).*")
             .is_match(line)
+        // Matching for rustdoc tests commands.
+        // It allows to prevent them emitting warnings like `line longer than 100 chars`.
+        || static_regex!(
+            "\\s*//@ \\!?(count|files|has|has-dir|hasraw|matches|matchesraw|snapshot)\\s.*"
+        ).is_match(line)
 }
 
 /// Returns `true` if `line` is allowed to be longer than the normal limit.