rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.73k stars 12.64k forks source link

x fmt formats way too many files #131324

Closed saethlin closed 1 week ago

saethlin commented 1 week ago

I am in this state (only 1 modified file):

╰ ➤ git diff --stat
 compiler/rustc_codegen_ssa/src/mir/mod.rs | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

But I just tried to format and got this:

╰ ➤ x fmt
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.03s
fmt: formatted 5608 modified files
Build completed successfully in 0:00:01

Something is quite wrong here. Formatting of only changed files must be correct, otherwise some files in the tree will get spurious formatting changes in PRs.

Perhaps https://github.com/rust-lang/rust/issues/131296 is related? I have a vague memory of seeing this misbehavior occasionally in the past though I'm only now remembering to file an issue.

bjorn3 commented 1 week ago

Formatting of only changed files must be correct, otherwise some files in the tree will get spurious formatting changes in PRs.

Don't we check formatting of all files in CI anyway?

onur-ozkan commented 1 week ago

Perhaps https://github.com/rust-lang/rust/issues/131296 is related? I have a vague memory of seeing this misbehavior occasionally in the past though I'm only now remembering to file an issue.

Most likely.

Don't we check formatting of all files in CI anyway?

On CI, yes.

saethlin commented 1 week ago

Interesting. I swear I've seen spurious formatting changes in PRs. Might be some other effect.

clubby789 commented 1 week ago

Should be closed by https://github.com/rust-lang/rust/pull/131331 (GH didn't pick up the comment)