-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
coverage: Format all coverage tests with rustfmt
#120015
Conversation
These tests deliberately use non-standard formatting, so that the line execution counts reported by `llvm-cov` reveal additional information about where code regions begin and end.
(rustbot has picked a reviewer for you, use r? to override) |
I have deliberately avoided touching (If there's any doubt, I'm happy to wait until after that PR has had a chance to land.) |
Some of these tests use non-standard formatting that we can simulate by strategically adding `//` line comments. One contains `where` clauses that would be split across multiple lines, which we can keep on one line by moving the bounds to the generic type instead.
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.
Thank you for following up on this!
@bors r+ delegate+ |
In case any other minor changes are needed to make this pass in CI, feel free to use r=dtolnay. |
FYI, I have decided to remove the formatting change in |
These tests can simply be reformatted as normal, because the resulting changes are unimportant.
@bors r=dtolnay |
coverage: Format all coverage tests with `rustfmt` As suggested by <rust-lang#119984 (comment)>. Test files in `tests/` are normally ignored by `x fmt`, but sometimes those files end up being run through `rustfmt` anyway, either by `rust-analyzer` or by hand. When that happens, it's annoying to have to manually revert formatting changes that are unrelated to the actual changes being made. So it's helpful for the tests in the repository to already have standard formatting beforehand. However, there are several coverage tests that deliberately use non-standard formatting, so that line counts reveal more information about where code regions begin and end. In those cases, we can use `#[rustfmt::skip]` to prevent that code from being disturbed. `@rustbot` label +A-code-coverage
…llaumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#118257 (Make traits / trait methods detected by the dead code lint) - rust-lang#119997 (Fix impl stripped in rustdoc HTML whereas it should not be in case the impl is implemented on a type alias) - rust-lang#120000 (Ensure `callee_id`s are body owners) - rust-lang#120015 (coverage: Format all coverage tests with `rustfmt`) - rust-lang#120063 (Remove special handling of `box` expressions from parser) - rust-lang#120138 (Increase vscode settings.json `git.detectSubmodulesLimit`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 8 pull requests Successful merges: - rust-lang#116090 (Implement strict integer operations that panic on overflow) - rust-lang#118811 (Use `bool` instead of `PartiolOrd` as return value of the comparison closure in `{slice,Iteraotr}::is_sorted_by`) - rust-lang#119081 (Add Ipv6Addr::is_ipv4_mapped) - rust-lang#119461 (Use an interpreter in MIR jump threading) - rust-lang#119996 (Move OS String implementation into `sys`) - rust-lang#120015 (coverage: Format all coverage tests with `rustfmt`) - rust-lang#120027 (pattern_analysis: Remove `Ty: Copy` bound) - rust-lang#120084 (fix(rust-analyzer): use new pkgid spec to compare) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#120015 - Zalathar:format, r=dtolnay coverage: Format all coverage tests with `rustfmt` As suggested by <rust-lang#119984 (comment)>. Test files in `tests/` are normally ignored by `x fmt`, but sometimes those files end up being run through `rustfmt` anyway, either by `rust-analyzer` or by hand. When that happens, it's annoying to have to manually revert formatting changes that are unrelated to the actual changes being made. So it's helpful for the tests in the repository to already have standard formatting beforehand. However, there are several coverage tests that deliberately use non-standard formatting, so that line counts reveal more information about where code regions begin and end. In those cases, we can use `#[rustfmt::skip]` to prevent that code from being disturbed. ``@rustbot`` label +A-code-coverage
As suggested by #119984 (comment).
Test files in
tests/
are normally ignored byx fmt
, but sometimes those files end up being run throughrustfmt
anyway, either byrust-analyzer
or by hand.When that happens, it's annoying to have to manually revert formatting changes that are unrelated to the actual changes being made. So it's helpful for the tests in the repository to already have standard formatting beforehand.
However, there are several coverage tests that deliberately use non-standard formatting, so that line counts reveal more information about where code regions begin and end. In those cases, we can use
#[rustfmt::skip]
to prevent that code from being disturbed.@rustbot label +A-code-coverage