It would be nice to have the option to save the *.bk files in a separate directory too keep them out of the way. I could imagine a directory structure such as
project/src (contains source files)
project/target (contains build target)
project/backup (contains rustfmt backup files)
EDIT: Perhaps this option should remove the filename extension, bk, to allow recursive xdiff
xdiff project/src project/backup
Hopefully we'll get to the point where rustfmt is trusted enough not to need to store backups by default!
But regarding the feature, I would like it. Or another alternative: save backups as dotfiles so that they at least don't show up in ls.
Those *.bk files are so annoying. If there is an option to avoid them I certainly would use.
@cristianoliveira there is such an option! Set write-mode to overwrite either in rustfmt.toml or on the command line and we don't make .bk files. The plan is to make this the default behaviour for the 1.0 release.
@cristianoliveira the relevant issue for changing the default is #873.
Hello @nrc and @kamalmarhubi Thanks a lot for the quick feedback!
I'm gonna use this --write-mode option until it isn't default. :)
Do we really need this feature? What is the benefit compared to cp -r src backup && rustfmt --write-mode overwrite?
If a user forgets to make a backup and if rustfmt somehow fails, then there will be tears on the internet. I cannot judge if this will be a problem (Edit Language)
Most helpful comment
Those *.bk files are so annoying. If there is an option to avoid them I certainly would use.