Skip to content

Fix some tidy paper cuts #139867

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

Merged
merged 5 commits into from
Apr 16, 2025
Merged

Fix some tidy paper cuts #139867

merged 5 commits into from
Apr 16, 2025

Conversation

WaffleLapkin
Copy link
Member

The main thing this fixes is that currently, if you run x t tidy it will format ~6K files, even though it's supposed to format only modified files (whatever this is a useful optimization or not is besides the point). The problem is that x t tidy never writes the rustfmt stamp, so it always assumes rustfmt that was last used is outdated and we need to recheck everything. This PR fixes it by actually writing the stamp.

There are also some minor tweaks to comments/diagnostics. cc @Kobzol this probably conflicts with #138591. I didn't fix anything, just tried to document better the status quo.

r? @jieyouxu

@rustbot rustbot added A-tidy Area: The tidy tool 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 Apr 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 15, 2025

The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging.

cc @davidtwco, @wesleywiser

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes seem reasonable to me, and running this locally seems to do what I expect. r=me unless Jakub has change requests.

@jieyouxu
Copy link
Member

r? @Kobzol (in case you have requests re. #138591)

@rustbot rustbot assigned Kobzol and unassigned jieyouxu Apr 15, 2025
Copy link
Contributor

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one comment, otherwise fine. Some of the git comments will be obsolete after #138591, but that doesn't really matter.

update_rustfmt_version(build);
}
// Update `build/.rustfmt-stamp`, allowing this code to ignore files which has not been changed
// since last merge. This is similar to what `x fmt` does.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit misleading, because this function is actually called from x fmt.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I did not realize that! I just removed the sentence about x fmt.

If checking succeeded, it's equivalent to successfully formatting.
@WaffleLapkin
Copy link
Member Author

@bors r=jieyouxu

@bors
Copy link
Collaborator

bors commented Apr 15, 2025

📌 Commit 90aec13 has been approved by jieyouxu

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 Apr 15, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Apr 16, 2025
Fix some tidy paper cuts

The main thing this fixes is that currently, if you run `x t tidy` it will format ~6K files, even though it's supposed to format only modified files (whatever this is a useful optimization or not is besides the point). The problem is that `x t tidy` never writes the `rustfmt` stamp, so it always assumes `rustfmt` that was last used is outdated and we need to recheck everything. This PR fixes it by actually writing the stamp.

There are also some minor tweaks to comments/diagnostics. cc `@Kobzol` this probably conflicts with rust-lang#138591. I didn't fix anything, just tried to document better the status quo.

r? `@jieyouxu`
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 16, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang#136926 (Stabilize `-Zdwarf-version` as `-Cdwarf-version`)
 - rust-lang#139647 (Add unstable parsing of `--extern foo::bar=libbar.rlib` command line options)
 - rust-lang#139853 (Disable combining LLD with external llvm-config)
 - rust-lang#139867 (Fix some tidy paper cuts)
 - rust-lang#139871 (Fix wrong "move keyword" suggestion for async gen block)
 - rust-lang#139880 (Don't compute name of associated item if it's an RPITIT)
 - rust-lang#139884 (Update books)
 - rust-lang#139886 (`borrowck_graphviz_*` attribute tweaks)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Apr 16, 2025
Fix some tidy paper cuts

The main thing this fixes is that currently, if you run `x t tidy` it will format ~6K files, even though it's supposed to format only modified files (whatever this is a useful optimization or not is besides the point). The problem is that `x t tidy` never writes the `rustfmt` stamp, so it always assumes `rustfmt` that was last used is outdated and we need to recheck everything. This PR fixes it by actually writing the stamp.

There are also some minor tweaks to comments/diagnostics. cc ``@Kobzol`` this probably conflicts with rust-lang#138591. I didn't fix anything, just tried to document better the status quo.

r? ``@jieyouxu``
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 16, 2025
Rollup of 10 pull requests

Successful merges:

 - rust-lang#139647 (Add unstable parsing of `--extern foo::bar=libbar.rlib` command line options)
 - rust-lang#139823 (Fix some bootstrap papercuts)
 - rust-lang#139853 (Disable combining LLD with external llvm-config)
 - rust-lang#139867 (Fix some tidy paper cuts)
 - rust-lang#139871 (Fix wrong "move keyword" suggestion for async gen block)
 - rust-lang#139876 (Make CodeStats' type_sizes public)
 - rust-lang#139880 (Don't compute name of associated item if it's an RPITIT)
 - rust-lang#139884 (Update books)
 - rust-lang#139886 (`borrowck_graphviz_*` attribute tweaks)
 - rust-lang#139893 (Add test for issue 125668)

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

Rollup of 9 pull requests

Successful merges:

 - rust-lang#139647 (Add unstable parsing of `--extern foo::bar=libbar.rlib` command line options)
 - rust-lang#139823 (Fix some bootstrap papercuts)
 - rust-lang#139867 (Fix some tidy paper cuts)
 - rust-lang#139871 (Fix wrong "move keyword" suggestion for async gen block)
 - rust-lang#139876 (Make CodeStats' type_sizes public)
 - rust-lang#139880 (Don't compute name of associated item if it's an RPITIT)
 - rust-lang#139884 (Update books)
 - rust-lang#139886 (`borrowck_graphviz_*` attribute tweaks)
 - rust-lang#139893 (Add test for issue 125668)

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

Rollup of 9 pull requests

Successful merges:

 - rust-lang#139647 (Add unstable parsing of `--extern foo::bar=libbar.rlib` command line options)
 - rust-lang#139823 (Fix some bootstrap papercuts)
 - rust-lang#139867 (Fix some tidy paper cuts)
 - rust-lang#139871 (Fix wrong "move keyword" suggestion for async gen block)
 - rust-lang#139876 (Make CodeStats' type_sizes public)
 - rust-lang#139880 (Don't compute name of associated item if it's an RPITIT)
 - rust-lang#139884 (Update books)
 - rust-lang#139886 (`borrowck_graphviz_*` attribute tweaks)
 - rust-lang#139893 (Add test for issue 125668)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b65e6b7 into rust-lang:master Apr 16, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 16, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 16, 2025
Rollup merge of rust-lang#139867 - WaffleLapkin:tidypaper, r=jieyouxu

Fix some tidy paper cuts

The main thing this fixes is that currently, if you run `x t tidy` it will format ~6K files, even though it's supposed to format only modified files (whatever this is a useful optimization or not is besides the point). The problem is that `x t tidy` never writes the `rustfmt` stamp, so it always assumes `rustfmt` that was last used is outdated and we need to recheck everything. This PR fixes it by actually writing the stamp.

There are also some minor tweaks to comments/diagnostics. cc ```@Kobzol``` this probably conflicts with rust-lang#138591. I didn't fix anything, just tried to document better the status quo.

r? ```@jieyouxu```
@Kobzol
Copy link
Contributor

Kobzol commented Apr 17, 2025

x fmt is wonderfully fast now, thanks!

@WaffleLapkin WaffleLapkin deleted the tidypaper branch April 17, 2025 13:05
@WaffleLapkin
Copy link
Member Author

@Kobzol I don't think this changed x fmt, right? for x fmt checked = false so we would commit the stump even before this.

but ur welcome :)

@Kobzol
Copy link
Contributor

Kobzol commented Apr 17, 2025

Hmm, maybe it was confirmation bias =D But tidy felt faster too :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tidy Area: The tidy tool 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.

None yet

5 participants