x fmt formats way too many files · Issue #131324 · rust-lang/rust (original) (raw)

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 #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.