Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get rid of tidy 'unnecessarily ignored' warnings #98717

Merged
merged 1 commit into from
Jul 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions src/tools/tidy/src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,6 @@ pub fn check(path: &Path, bad: &mut bool) {
);
};
suppressible_tidy_err!(err, skip_file_length, "");
} else if lines > (LINES * 7) / 10 {
// Just set it to something that doesn't trigger the "unnecessarily ignored" warning.
skip_file_length = Directive::Ignore(true);
}

if let Directive::Ignore(false) = skip_cr {
Expand All @@ -406,12 +403,6 @@ pub fn check(path: &Path, bad: &mut bool) {
if let Directive::Ignore(false) = skip_tab {
tidy_error!(bad, "{}: ignoring tab characters unnecessarily", file.display());
}
if let Directive::Ignore(false) = skip_line_length {
tidy_error!(bad, "{}: ignoring line length unnecessarily", file.display());
}
if let Directive::Ignore(false) = skip_file_length {
tidy_error!(bad, "{}: ignoring file length unnecessarily", file.display());
}
if let Directive::Ignore(false) = skip_end_whitespace {
tidy_error!(bad, "{}: ignoring trailing whitespace unnecessarily", file.display());
}
Expand All @@ -424,5 +415,9 @@ pub fn check(path: &Path, bad: &mut bool) {
if let Directive::Ignore(false) = skip_copyright {
tidy_error!(bad, "{}: ignoring copyright unnecessarily", file.display());
}
// We deliberately do not warn about these being unnecessary,
// that would just lead to annoying churn.
let _unused = skip_line_length;
let _unused = skip_file_length;
})
}