Fix tidy issue for rustdoc tests commands · rust-lang/rust@4e258bb

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.