Skip to content

Commit da05401

Browse files
committed
removed tidy check on issues files
1 parent 8231065 commit da05401

File tree

2 files changed

+9
-54
lines changed

2 files changed

+9
-54
lines changed

src/tools/tidy/src/ui_tests.rs

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,18 @@
22
//! - the number of entries in each directory must be less than `ENTRY_LIMIT`
33
//! - there are no stray `.stderr` files
44
5-
use std::collections::{BTreeSet, HashMap};
5+
use std::collections::BTreeSet;
66
use std::ffi::OsStr;
77
use std::fs;
88
use std::io::Write;
9-
use std::path::{Path, PathBuf};
10-
11-
use ignore::Walk;
9+
use std::path::Path;
1210

1311
// FIXME: GitHub's UI truncates file lists that exceed 1000 entries, so these
1412
// should all be 1000 or lower. Limits significantly smaller than 1000 are also
1513
// desirable, because large numbers of files are unwieldy in general. See issue
1614
// #73494.
17-
const ENTRY_LIMIT: u32 = 901;
18-
// FIXME: The following limits should be reduced eventually.
1915

20-
const ISSUES_ENTRY_LIMIT: u32 = 1616;
16+
// FIXME: The following limits should be reduced eventually.
2117

2218
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
2319
"rs", // test source files
@@ -54,50 +50,13 @@ const EXTENSION_EXCEPTION_PATHS: &[&str] = &[
5450
"tests/ui/std/windows-bat-args3.bat", // tests escaping arguments through batch files
5551
];
5652

57-
fn check_entries(tests_path: &Path, bad: &mut bool) {
58-
let mut directories: HashMap<PathBuf, u32> = HashMap::new();
59-
60-
for entry in Walk::new(tests_path.join("ui")).flatten() {
61-
let parent = entry.path().parent().unwrap().to_path_buf();
62-
*directories.entry(parent).or_default() += 1;
63-
}
64-
65-
let (mut max, mut max_issues) = (0, 0);
66-
for (dir_path, count) in directories {
67-
let is_issues_dir = tests_path.join("ui/issues") == dir_path;
68-
let (limit, maxcnt) = if is_issues_dir {
69-
(ISSUES_ENTRY_LIMIT, &mut max_issues)
70-
} else {
71-
(ENTRY_LIMIT, &mut max)
72-
};
73-
*maxcnt = (*maxcnt).max(count);
74-
if count > limit {
75-
tidy_error!(
76-
bad,
77-
"following path contains more than {} entries, \
78-
you should move the test to some relevant subdirectory (current: {}): {}",
79-
limit,
80-
count,
81-
dir_path.display()
82-
);
83-
}
84-
}
85-
if ISSUES_ENTRY_LIMIT > max_issues {
86-
tidy_error!(
87-
bad,
88-
"`ISSUES_ENTRY_LIMIT` is too high (is {ISSUES_ENTRY_LIMIT}, should be {max_issues})"
89-
);
90-
}
91-
}
92-
9353
pub fn check(root_path: &Path, bless: bool, bad: &mut bool) {
9454
let issues_txt_header = r#"============================================================
9555
⚠️⚠️⚠️NOTHING SHOULD EVER BE ADDED TO THIS LIST⚠️⚠️⚠️
9656
============================================================
9757
"#;
9858

9959
let path = &root_path.join("tests");
100-
check_entries(path, bad);
10160

10261
// the list of files in ui tests that are allowed to start with `issue-XXXX`
10362
// BTreeSet because we would like a stable ordering so --bless works
@@ -207,15 +166,5 @@ pub fn check(root_path: &Path, bless: bool, bad: &mut bool) {
207166
}
208167
let old_issues_path = tidy_src.join("issues.txt");
209168
fs::rename(blessed_issues_path, old_issues_path).unwrap();
210-
} else {
211-
for file_name in remaining_issue_names {
212-
let mut p = PathBuf::from(path);
213-
p.push(file_name);
214-
tidy_error!(
215-
bad,
216-
"file `{}` no longer exists and should be removed from the exclusions in `src/tools/tidy/src/issues.txt`",
217-
p.display()
218-
);
219-
}
220169
}
221170
}

triagebot.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,12 @@ cc = ["@nnethercote"]
11471147
message = "Changes to the size of AST and/or HIR nodes."
11481148
cc = ["@nnethercote"]
11491149

1150+
[mentions."tests/ui/issues"]
1151+
message = """
1152+
This PR modifies `tests/ui/issues/`. If this PR is adding new tests to `tests/ui/issues/`,
1153+
please refrain from doing so, and add it to more descriptive subdirectories instead.
1154+
"""
1155+
11501156
[mentions."compiler/rustc_sanitizers"]
11511157
cc = ["@rcvalle"]
11521158

0 commit comments

Comments
 (0)