Skip to content
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

Format all source files in tests/coverage/ #125693

Merged
merged 2 commits into from
May 29, 2024
Merged

Conversation

Zalathar
Copy link
Contributor

Currently we can't automatically enforce formatting on tests (see #125637), but we can at least keep things relatively tidy by occasionally running the formatter manually.

This was done by temporarily commenting out the "/tests/" exclusion in rustfmt.toml, and then running:

  • x fmt tests/coverage
  • x test coverage --bless

(This PR also includes a few cosmetic tweaks to some of the affected files, to convince rustfmt to format them in the way we want.)

@rustbot label +A-code-coverage

Zalathar added 2 commits May 29, 2024 14:34
For coverage tests, splitting code across multiple lines often makes the
resulting coverage report easier to interpret, so we force rustfmt to retain
line breaks by adding dummy line comments with `//`.
Currently we can't automatically enforce formatting on tests (see rust-lang#125637), but
we can at least keep things relatively tidy by occasionally running the
formatter manually.

This was done by temporarily commenting out the `"/tests/"` exclusion in
`rustfmt.toml`, and then running `x fmt tests/coverage` and
`x test coverage --bless`.
@rustbot
Copy link
Collaborator

rustbot commented May 29, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) labels May 29, 2024
@Zalathar
Copy link
Contributor Author

The coverage tests were mostly already formatted by #120015, but a few things slipped through, and there were a few small differences caused by me not using the compiler's rustfmt.toml at that time.

@lqd
Copy link
Member

lqd commented May 29, 2024

I don't know how thoroughly one would need to look at this, but after reading it over, the changes look good to me -- if you want to consider that an r+

@Zalathar
Copy link
Contributor Author

Yeah, these are small cosmetic changes to tests I'm already pretty familiar with, so “looks good” seems like the right level of scrutiny.

@lqd
Copy link
Member

lqd commented May 29, 2024

If we don't want to remove this test suite from the ones ignored for formatting, so that it doesn't regress in the near future until we manage to format more tests, then @bors r+ rollup

It can be done soon enough nbd.

@bors
Copy link
Contributor

bors commented May 29, 2024

📌 Commit 9dc6e08 has been approved by lqd

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 29, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 29, 2024
Format all source files in `tests/coverage/`

Currently we can't automatically enforce formatting on tests (see rust-lang#125637), but we can at least keep things relatively tidy by occasionally running the formatter manually.

This was done by temporarily commenting out the `"/tests/"` exclusion in `rustfmt.toml`, and then running:
- `x fmt tests/coverage`
- `x test coverage --bless`

(This PR also includes a few cosmetic tweaks to some of the affected files, to convince rustfmt to format them in the way we want.)

`@rustbot` label +A-code-coverage
bors added a commit to rust-lang-ci/rust that referenced this pull request May 29, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#107099 (rustdoc: Add support for --remap-path-prefix)
 - rust-lang#125693 (Format all source files in `tests/coverage/`)
 - rust-lang#125700 (coverage: Avoid overflow when the MC/DC condition limit is exceeded)
 - rust-lang#125705 (Reintroduce name resolution check for trying to access locals from an inline const)
 - rust-lang#125708 (tier 3 target policy: clarify the point about producing assembly)
 - rust-lang#125715 (remove unneeded extern crate in rmake test)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request May 29, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#124655 (Add `-Zfixed-x18`)
 - rust-lang#125693 (Format all source files in `tests/coverage/`)
 - rust-lang#125700 (coverage: Avoid overflow when the MC/DC condition limit is exceeded)
 - rust-lang#125705 (Reintroduce name resolution check for trying to access locals from an inline const)
 - rust-lang#125708 (tier 3 target policy: clarify the point about producing assembly)
 - rust-lang#125715 (remove unneeded extern crate in rmake test)
 - rust-lang#125719 (Extract coverage-specific code out of `compiletest::runtest`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit a7a2fa5 into rust-lang:master May 29, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 29, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 29, 2024
Rollup merge of rust-lang#125693 - Zalathar:format, r=lqd

Format all source files in `tests/coverage/`

Currently we can't automatically enforce formatting on tests (see rust-lang#125637), but we can at least keep things relatively tidy by occasionally running the formatter manually.

This was done by temporarily commenting out the `"/tests/"` exclusion in `rustfmt.toml`, and then running:
- `x fmt tests/coverage`
- `x test coverage --bless`

(This PR also includes a few cosmetic tweaks to some of the affected files, to convince rustfmt to format them in the way we want.)

``@rustbot`` label +A-code-coverage
@Zalathar Zalathar deleted the format branch May 29, 2024 22:56
@fmease
Copy link
Member

fmease commented May 29, 2024

bors sleepy @bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 29, 2024
nnethercote added a commit to nnethercote/rust that referenced this pull request May 30, 2024
There are no changes to `.rs` files because rust-lang#125693 recently formatted
them all.
nnethercote added a commit to nnethercote/rust that referenced this pull request May 31, 2024
There are no changes to `.rs` files because rust-lang#125693 recently formatted
them all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants