Rollup merge of #121375 - chenyukang:yukang-fix-tidy, r=albertlarsan68

Print proper relative path for descriptive name check

The `stripped_path` starts with `ui/...`, while we are mostly working in `rust` directory.
print a relative path starting with `tests/ui/...` so that we can copy and use the path when renaming.

Hardcoding the `tests` maybe not good style, but seems we have a lot of hardcoded `tests/..` paths in tidy check :(.
This commit is contained in:
Dylan DPC 2024-02-21 08:55:59 +00:00 committed by GitHub
commit 229108a6a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -162,7 +162,7 @@ pub fn check(path: &Path, bless: bool, bad: &mut bool) {
if !remaining_issue_names.remove(stripped_path) {
tidy_error!(
bad,
"file `{stripped_path}` must begin with a descriptive name, consider `{{reason}}-issue-{issue_n}.rs`",
"file `tests/{stripped_path}` must begin with a descriptive name, consider `{{reason}}-issue-{issue_n}.rs`",
issue_n = &test_name[1],
);
}