Skip to content

Commit

Permalink
Rollup merge of #122126 - workingjubilee:every-os-in-the-world-belong…
Browse files Browse the repository at this point in the history
…s-to-unix, r=ChrisDenton

Fix `tidy --bless` on  ̶X̶e̶n̶i̶x̶ Windows

As reported in #120628 (comment) the requested `tidy --bless` implementation didn't take into account the fact that earlier the linting code canonicalized things to use the OS path separator. This makes it so that the path separator is always rewritten back as '/', which should fix the variance there.

r? `@ChrisDenton`
  • Loading branch information
workingjubilee authored Mar 7, 2024
2 parents 3a4b2c1 + bf9782d commit c22cf59
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tools/tidy/src/ui_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ pub fn check(path: &Path, bless: bool, bad: &mut bool) {
let blessed_issues_path = tidy_src.join("issues_blessed.txt");
let mut blessed_issues_txt = fs::File::create(&blessed_issues_path).unwrap();
blessed_issues_txt.write(issues_txt_header.as_bytes()).unwrap();
for filename in allowed_issue_names.difference(&remaining_issue_names) {
// If we changed paths to use the OS separator, reassert Unix chauvinism for blessing.
for filename in allowed_issue_names
.difference(&remaining_issue_names)
.map(|s| s.replace(std::path::MAIN_SEPARATOR_STR, "/"))
{
write!(blessed_issues_txt, "\"{filename}\",\n").unwrap();
}
write!(blessed_issues_txt, "]\n").unwrap();
Expand Down

0 comments on commit c22cf59

Please sign in to comment.