mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
Rollup merge of #94178 - est31:tolerant_lines_check, r=Mark-Simulacrum
tidy: fire less "ignoring file length unneccessarily" warnings This avoids a situation where a file is at the border of the limit, and alternates between hitting the limit and not hitting it, causing a back and forth of addition of the ignore-tidy-linelength directive. As an example, consider the ignore-tidy-filelength of compiler/rustc_typeck/src/collect.rs. It was added in2ca4964db5
, removed in37354ebc97
(a revert of the earlier commit), added again in448d07683a
, removed in3171bd5bf5
, added in438826fd1a
, and removed inbb0a2f985c
. To avoid this back and forth, we exempt files from the unneccessary ignoring warning that have length of at least 70% of the limit.
This commit is contained in:
commit
a53b604fea
@ -395,6 +395,9 @@ 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 "unneccessarily ignored" warning.
|
||||
skip_file_length = Directive::Ignore(true);
|
||||
}
|
||||
|
||||
if let Directive::Ignore(false) = skip_cr {
|
||||
|
Loading…
Reference in New Issue
Block a user