-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reimpl meaningful test name lint MCP658 #120628
Reimpl meaningful test name lint MCP658 #120628
Conversation
This comment has been minimized.
This comment has been minimized.
...of course. |
11fb805
to
0c3a300
Compare
@bors p=20 |
@@ -0,0 +1,4376 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~4000/~15000.... that's a lot of grandfathers 🫠
let mut p = PathBuf::from(path); | ||
p.push(file_name); | ||
tidy_error!( | ||
bad, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be very cool if tidy --bless
ing removed it for you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that sounds plausible.
I'm in favor of this change, but given its size, do you mind if we wait a few days for the bors queue to calm down a bit? |
No problem if you help me remember when / give me a poke to rebase it by the usual venues. |
howdy @workingjubilee, I think I'm ready to review this if you're able to rebase it. I'd also really like if @rustbot author |
This reverts commit 686b3de.
As the reason for tidy failing the test name may seem slightly opaque, provide a suggestion on how to rename the file. There are some tests which merely would require reordering of the name according to the rule. I could modify the diagnostic further to identify those, but doing such would make it prone to bad suggestions. I have opted to trust contributors to recognize the diagnostic is robotic, as the pattern we are linting on is easier to match if we do not speculate on what parts of the name are meaningful: sometimes a word is a reason, but sometimes it is a mere "tag", such as with a pair like: issue-314159265-blue.rs issue-314159265-red.rs Starting them with `red-` and `blue-` means they do not sort together, despite being related, and the color names are still not very descriptive. Recognizing a good name is an open-ended task, though this pair might be: colored-circle-gen-blue.rs colored-circle-gen-red.rs Deciding exactly how to solve this is not the business of tidy, only recognizing a what.
~130 new entries, depending on how you count, with the rest being sorting churn.
0c3a300
to
ce72a3f
Compare
@rustbot review |
"ui/c-variadic/issue-32201.rs", | ||
"ui/c-variadic/issue-86053-1.rs", | ||
"ui/c-variadic/issue-86053-2.rs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new order was not quite stable for this round, as I had been using sort --unique
for the last sort, but it should be in the future, as BTreeSet yields items in order when iterated and uses the Ord of String.
@bors r+ rollup=iffy |
☀️ Test successful - checks-actions |
Finished benchmarking commit (0b9f6ad): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 638.5s -> 638.786s (0.04%) |
@workingjubilee |
Odd! Noted and will fix, apologies. |
…ld-belongs-to-unix, r=ChrisDenton Fix `tidy --bless` on ̶X̶e̶n̶i̶x̶ Windows As reported in rust-lang#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`
…ld-belongs-to-unix, r=ChrisDenton Fix `tidy --bless` on ̶X̶e̶n̶i̶x̶ Windows As reported in rust-lang#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``
Rollup merge of rust-lang#122126 - workingjubilee:every-os-in-the-world-belongs-to-unix, r=ChrisDenton Fix `tidy --bless` on ̶X̶e̶n̶i̶x̶ Windows As reported in rust-lang#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``
…s-to-unix, r=ChrisDenton Fix `tidy --bless` on ̶X̶e̶n̶i̶x̶ Windows As reported in rust-lang/rust#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``
This reintroduces the tidy rule originally proposed in #113583 that then became an MCP in rust-lang/compiler-team#658 which eventually surfaced a quite-reasonable request for a diagnostic enhancement. I have added that to the rule. It produces output like this:
You get the idea.
There are some tests which merely would require reordering of the name according to the rule. I could modify the diagnostic further to identify those, but doing such would make it prone to bad suggestions. I have opted to trust contributors to recognize the diagnostic is robotic, as the pattern we are linting on is easier to match if we do not speculate on what parts of the name are meaningful: sometimes a word is a reason, but sometimes it is a mere "tag", such as with a pair like:
Starting them with
red-
andblue-
means they do not sort together, despite being related, and the color names are still not very descriptive. Recognizing a good name is an open-ended task, though this pair might be:Deciding exactly how to solve this is not the business of tidy, only recognizing a what.
r? @compiler-errors