Skip to content

Commit

Permalink
add tidy warning for "tidy-ignore"
Browse files Browse the repository at this point in the history
Fixes #130984.
Tidy now warns on seeing the typo "tidy-ignore-{CHECK}" (it's actually "ignore-tidy").
  • Loading branch information
cod10129 committed Jan 12, 2025
1 parent 48a426e commit 980a521
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tools/tidy/src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,9 @@ pub fn check(path: &Path, bad: &mut bool) {
suppressible_tidy_err!(err, skip_cr, "CR character");
}
if !is_this_file {
if line.contains("tidy-ignore") {
err("use ignore-tidy-[check], not tidy-ignore-[check]");
}
// Allow using TODO in diagnostic suggestions by marking the
// relevant line with `// ignore-tidy-todo`.
if trimmed.contains("TODO") && !trimmed.contains("ignore-tidy-todo") {
Expand Down

0 comments on commit 980a521

Please sign in to comment.