Skip to content

Save *.bk files in a separate directory such as project/backup #796

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

Closed
nielsle opened this issue Feb 1, 2016 · 8 comments
Closed

Save *.bk files in a separate directory such as project/backup #796

nielsle opened this issue Feb 1, 2016 · 8 comments

Comments

@nielsle
Copy link

nielsle commented Feb 1, 2016

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
@kamalmarhubi
Copy link
Contributor

Hopefully we'll get to the point where rustfmt is trusted enough not to need to store backups by default!

@kamalmarhubi
Copy link
Contributor

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.

@cristianoliveira
Copy link

Those *.bk files are so annoying. If there is an option to avoid them I certainly would use.

@nrc
Copy link
Member

nrc commented Apr 17, 2016

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

@kamalmarhubi
Copy link
Contributor

@cristianoliveira the relevant issue for changing the default is #873.

@cristianoliveira
Copy link

cristianoliveira commented Apr 18, 2016

Hello @nrc and @kamalmarhubi Thanks a lot for the quick feedback!
I'm gonna use this --write-mode option until it isn't default. :)

@matklad
Copy link
Member

matklad commented Aug 1, 2016

Do we really need this feature? What is the benefit compared to cp -r src backup && rustfmt --write-mode overwrite?

@nielsle
Copy link
Author

nielsle commented Aug 1, 2016

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)

@nrc nrc closed this as completed Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants