From 02ac0ef990f576ee77954ebaed24a6d931cac0a9 Mon Sep 17 00:00:00 2001 From: yukang Date: Fri, 8 Mar 2024 13:03:00 +0800 Subject: [PATCH] fix --- src/tools/tidy/src/ui_tests.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 1a53637ad42f9..4e5b6875f9d40 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -104,9 +104,18 @@ pub fn check(path: &Path, bless: bool, bad: &mut bool) { // the list of files in ui tests that are allowed to start with `issue-XXXX` // BTreeSet because we would like a stable ordering so --bless works - let allowed_issue_names = BTreeSet::from( - include!("issues.txt").map(|path| path.replace("/", std::path::MAIN_SEPARATOR_STR)), - ); + let issues_list = + include!("issues.txt").map(|path| path.replace("/", std::path::MAIN_SEPARATOR_STR)); + let issues: Vec = Vec::from(issues_list.clone()); + let is_sorted = issues.windows(2).all(|w| w[0] <= w[1]); + if !is_sorted && !bless { + tidy_error!( + bad, + "`src/tools/tidy/src/issues.txt` is not in order, mostly because you modified it manually, + please only update it with command `x test tidy --bless`" + ); + } + let allowed_issue_names = BTreeSet::from(issues_list); let mut remaining_issue_names: BTreeSet = allowed_issue_names.clone();