-
Notifications
You must be signed in to change notification settings - Fork 13.3k
UI tests: remove redundant colons in line annotations #139448
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
Conversation
Search: `(//(\[.*\])?~.*(HELP|ERROR|NOTE|HELP|WARN|WARNING)):` Replace with: `$1` In: `./tests/{ui,ui-fulldeps,rustdoc-ui,incremental}/**/*.{rs,fixed}`
@rust-lang/compiler What do you think? |
I don't think this is a useful change as I don't see the benefit in forcing annotations to be one way or the other. It also makes it harder for someone to just copy the error message from stderr and turn that into an annotation, i.e.:
turned into
|
#139427 will also make it harder by standardizing on Also "do not just copy-paste" is sort of by design? |
Fair. I am not seeing a lot of benefits for the churn here, but I won't stand in the way of progress if others agree that this is a good idea :) |
personally in favor, our UI test suite will continue to exist for quite a while and the merge conflicts caused by this change should be rare and easy to fix. I think having multiple possibe ways to express stuff here is confusing |
This comment was marked as outdated.
This comment was marked as outdated.
I think we should write these with a colon, and would rather see the style without colon removed. The absence of the colon makes it harder to read since it lacks a clear separation of "keyword" (error level) and message. The ui_test crate (used by clippy and Miri for their ui tests) also requires the colon. So IMO this PR makes things strictly worse. Also IMO this requires an MCP given that it's a tree-wide change that will affect basically every compiler dev. |
That's an order of magnitude larger change though.
If the keyword is uppercase, like
Sure, just collecting an initial reaction for now. |
I didn't know you could (a) write |
Funny data point: ui_test and thus miri and clippy require the colon |
Personally I'd be in favor of always requiring a colon, so sth more like
But agreed that this is something that we should have an MCP to decide on a consistent way to write the ui test annotations (I'm less attached to which, but just having a consistent style). |
Slightly off-topic, but, compiletest currently has multiple bits where it's too lax in what "alternative forms" are accepted for IMHO no real benefit (and arguably leads to confusion), such as in directive handling. In that sense, I'm very much in favor of PRs such as this where we reduce the variations possible and just converge on more canonical forms. |
FWIW there are already other differences in style to ui_test, where apparently compiletest was inspired by ui_test (at least, ui_test used that syntax first) but then decided to use a different style for no reason that I can recall having been discussed: |
You should add changing Miri and Clippy to the numbers for "remove colons". Though their test suites are much smaller so the result would probably not change substantially. However, I think the fact the one tool we use in the tree that forces a particular style does require the colon should carry some weight as well.
By that argument, Rust should use |
FWIW, I don't have anything against the first syntax, or against C++'s |
I have a really hard time reading (and writing) Go code due to the lack of a colon, I find it quite irritating. |
☔ The latest upstream changes (presumably #139482) made this pull request unmergeable. Please resolve the merge conflicts. |
I always strongly preferred I like the idea of having a single style, thought I also think this should be an MCP. While I understand the idea behind making the most common choice the only possible, I don't think that |
given my perceived agreement that we should unify the style here, and the disagreement about what it should be. Please open an MCP (with prolly just a quick vote of compiler team members to paint the bikeshed)
:< I very much prefer forced upper-case style |
I'll close this since there's an open MCP now. |
The first commit is a mechanical change.
Search:
(//(\[.*\])?~.*(HELP|ERROR|NOTE|HELP|WARN|WARNING)):
Replace with:
$1
In:
./tests/{ui,ui-fulldeps,rustdoc-ui,incremental}/**/*.{rs,fixed}
The colons are redundant, and annotations without the colons are shorter, less noisy, and overwhelmingly more common, so let's standardize on the colon-less syntax.
#139427 and one more follow up PR will make sure that new colons won't appear.
After merging the first commit will need to be added to
.git-blame-ignore-revs
.r? @jieyouxu