Skip to content

Commit 02ac0ef

Browse files
committed
fix
1 parent c60db50 commit 02ac0ef

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/tools/tidy/src/ui_tests.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,18 @@ pub fn check(path: &Path, bless: bool, bad: &mut bool) {
104104

105105
// the list of files in ui tests that are allowed to start with `issue-XXXX`
106106
// BTreeSet because we would like a stable ordering so --bless works
107-
let allowed_issue_names = BTreeSet::from(
108-
include!("issues.txt").map(|path| path.replace("/", std::path::MAIN_SEPARATOR_STR)),
109-
);
107+
let issues_list =
108+
include!("issues.txt").map(|path| path.replace("/", std::path::MAIN_SEPARATOR_STR));
109+
let issues: Vec<String> = Vec::from(issues_list.clone());
110+
let is_sorted = issues.windows(2).all(|w| w[0] <= w[1]);
111+
if !is_sorted && !bless {
112+
tidy_error!(
113+
bad,
114+
"`src/tools/tidy/src/issues.txt` is not in order, mostly because you modified it manually,
115+
please only update it with command `x test tidy --bless`"
116+
);
117+
}
118+
let allowed_issue_names = BTreeSet::from(issues_list);
110119

111120
let mut remaining_issue_names: BTreeSet<String> = allowed_issue_names.clone();
112121

0 commit comments

Comments
 (0)