-
Notifications
You must be signed in to change notification settings - Fork 926
If FILE.rs.bk exists, rustfmt will sometimes overwrite it with formatted FILE.rs, regardless of write-mode #399
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
Comments
Hmmm, I can't reproduce this. Could you post some extra context? |
I just updated the issue with more details, could you try again? |
Ah, thanks. Will play around with it a bit. |
I am hitting this now. This is most curious. Thanks for the report! |
Wait, doesn't it make sense? |
When you run rustfmt in replace mode twice, it will overwrite the backup file with the output of the first run. |
Not sure if this should be the behaviour.. maybe we should simply overwrite if the backup file is found, or abort? |
You might be right. I only came into the issue by running a Python script to run it on all .rs files in a directory (recursively)... I may be running it on the same file more than once. I'm going to double check that everything in this script is working correctly. |
Note that |
That would be the issue. Sorry for the confusion! Closing. On another note, however, is there a way to disable that? (I'm running it on a complicated project which consists of many crates with some common files). |
Not as of this moment, no. But wait, crates having common files? That's madness, yo! |
They're in fact not primarily crates. While building them with Cargo is an option, the normal method is using a Makefile. (The project is uutils/coreutils). Should I open an issue for having that as an option? |
Sure, that sounds good. I'm curious to see what others think about that. |
c_types.rs
causes this issue. Notice the change in file size and modification date.The text was updated successfully, but these errors were encountered: