Rollup merge of #125307 - workingjubilee:uproot-entry-limit, r=Mark-Simulacrum

tidy: stop special-casing tests/ui entry limit

It is genuinely more annoying to have this error, now that this value is below the general `ENTRY_LIMIT` cap, when one is trying to clean out tests from tests/ui! This code has served its purpose well, let it rest now rather than force it to continue haunting us.
This commit is contained in:
Matthias Krüger 2024-05-26 13:43:05 +02:00 committed by GitHub
commit e346404fca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,7 +16,6 @@
// FIXME: The following limits should be reduced eventually.
const ISSUES_ENTRY_LIMIT: usize = 1676;
const ROOT_ENTRY_LIMIT: usize = 757;
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
"rs", // test source files
@ -63,14 +62,10 @@ fn check_entries(tests_path: &Path, bad: &mut bool) {
}
}
let (mut max, mut max_root, mut max_issues) = (0usize, 0usize, 0usize);
let (mut max, mut max_issues) = (0usize, 0usize);
for (dir_path, count) in directories {
// Use special values for these dirs.
let is_root = tests_path.join("ui") == dir_path;
let is_issues_dir = tests_path.join("ui/issues") == dir_path;
let (limit, maxcnt) = if is_root {
(ROOT_ENTRY_LIMIT, &mut max_root)
} else if is_issues_dir {
let (limit, maxcnt) = if is_issues_dir {
(ISSUES_ENTRY_LIMIT, &mut max_issues)
} else {
(ENTRY_LIMIT, &mut max)
@ -87,12 +82,6 @@ fn check_entries(tests_path: &Path, bad: &mut bool) {
);
}
}
if ROOT_ENTRY_LIMIT > max_root {
tidy_error!(
bad,
"`ROOT_ENTRY_LIMIT` is too high (is {ROOT_ENTRY_LIMIT}, should be {max_root})"
);
}
if ISSUES_ENTRY_LIMIT > max_issues {
tidy_error!(
bad,