Skip to content

Commit

Permalink
tidy: support ignore-tidy for Markdown files
Browse files Browse the repository at this point in the history
To be used to skip the `tab` check in `jobserver.md`.

Signed-off-by: Miguel Ojeda <[email protected]>
  • Loading branch information
ojeda committed Feb 24, 2024
1 parent 8f359be commit 57da90e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tools/tidy/src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ fn contains_ignore_directive(can_contain: bool, contents: &str, check: &str) ->
if contents.contains(&format!("// ignore-tidy-{check}"))
|| contents.contains(&format!("# ignore-tidy-{check}"))
|| contents.contains(&format!("/* ignore-tidy-{check} */"))
|| contents.contains(&format!("<!-- ignore-tidy-{check} -->"))
{
Directive::Ignore(false)
} else {
Expand Down Expand Up @@ -305,7 +306,8 @@ pub fn check(path: &Path, bad: &mut bool) {

let can_contain = contents.contains("// ignore-tidy-")
|| contents.contains("# ignore-tidy-")
|| contents.contains("/* ignore-tidy-");
|| contents.contains("/* ignore-tidy-")
|| contents.contains("<!-- ignore-tidy-");
// Enable testing ICE's that require specific (untidy)
// file formats easily eg. `issue-1234-ignore-tidy.rs`
if filename.contains("ignore-tidy") {
Expand Down

0 comments on commit 57da90e

Please sign in to comment.