Skip to content

Commit 4e258bb

Browse files
Fix tidy issue for rustdoc tests commands
1 parent 51fedf6 commit 4e258bb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/tools/tidy/src/style.rs

+5
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ fn should_ignore(line: &str) -> bool {
186186
// - `//@[rev] normalize-stderr-test`
187187
|| static_regex!("\\s*//@(\\[.*\\]) (compile-flags|normalize-stderr-test|error-pattern).*")
188188
.is_match(line)
189+
// Matching for rustdoc tests commands.
190+
// It allows to prevent them emitting warnings like `line longer than 100 chars`.
191+
|| static_regex!(
192+
"\\s*//@ \\!?(count|files|has|has-dir|hasraw|matches|matchesraw|snapshot)\\s.*"
193+
).is_match(line)
189194
}
190195

191196
/// Returns `true` if `line` is allowed to be longer than the normal limit.

0 commit comments

Comments
 (0)