Skip to content

x fmt: Only check modified files locally #108773

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Mar 6, 2023
Merged

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Mar 5, 2023

Previously, x fmt would only format modified files, while x fmt . and x fmt --check would still look at all files. After this change, x fmt --check only looks at modified files locally.

I feel pretty confident in this change - other than #106261, no one has reported bugs in get_modified_rs_files since it was added in #105702.

Combined with the changes in #108772, this brings the time for me to run x t tidy with a hot FS cache down from 5 to 2 seconds (and moves the majority of the time spent back to tidy check, which means it can be sped up more in the future).

Previously, `x fmt` would only format modified files, while `x fmt .`
and `x fmt --check` would still look at all files. After this change, `x
fmt --check` only looks at modified files locally.

I feel pretty confident in this change - other than
rust-lang#106261, no one has reported
bugs in `get_modified_rs_files` since it was added in
rust-lang#105702.
@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2023

r? @albertlarsan68

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 5, 2023
@albertlarsan68
Copy link
Member

Looks great!

Thanks for the PR!
@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Mar 5, 2023

📌 Commit 620efed has been approved by albertlarsan68

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 Mar 5, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 6, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#108244 (Add test for semicolon recovery ICE)
 - rust-lang#108746 (Don't project to RPITIT that has no default value)
 - rust-lang#108764 (Tweaks to -Zdrop-tracking-mir)
 - rust-lang#108770 (Improve documentation and argument naming of some TyCtxt methods)
 - rust-lang#108773 (x fmt: Only check modified files locally)
 - rust-lang#108775 (Use the correct bound vars in return type suggestion.)
 - rust-lang#108776 (Make `x test tidy` less noisy)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7125df0 into rust-lang:master Mar 6, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 6, 2023
@jyn514 jyn514 deleted the faster-tidy-fmt branch August 27, 2023 16:54
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants