-
Notifications
You must be signed in to change notification settings - Fork 13k
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
x fmt should only format modified files by default #105688
Comments
This will need to be careful to still rerun rustfmt when we bump its version (which happens about every 6 weeks). Maybe we can generate a |
Hello, |
@albertlarsan68 you can use |
This means that already-commited files that were not formatted when committed would not be formatted, right ? |
Ah, good point. You can use |
Thanks, I will start working on this ! @rustbot claim |
That assumes that the rust-lang remote is labeled as origin. I call that upstream and my fork origin. Using the local master may also not work if one does |
Yes, #105058 has a more general solution. |
PR is up at #105702 |
As discussed on rust-lang#105688, this makes x fmt only format modified files
Since rustfmt is deterministic and idempotent, running it twice on the same file should always have the same output (if it's not both of those things, it's a bug). So we can avoid running it unless the file has changed, which should make
x fmt
without arguments much faster.Originally posted by @chenyukang in #105648 (comment)
The text was updated successfully, but these errors were encountered: