-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Ignore *.bk files generated by rustfmt in cargo-generated .gitignore #2409
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @huonw (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I have always felt like these files were totally superflous. @nrc are there any plans to make rustfmt just stop generating these files? |
(If not, then huge 👍 from me) |
I personally prefer to be pretty conservative with gitignore directives (and very liberal with global gitignore directives), and I suspect that rustfmt is the tool here which may want to not generate *.bk files by default. Which I guess is another way of saying I'd rather not add this to Cargo just yet and see if we can perhaps tweak the experience of using rustfmt |
Closing due to my previous comment. |
@nrc any updates on this? I actually don't mind whether rustfmt generates these files by default or not as long as there is an option to not generate them. The @alexcrichton the extension is not That would work on old and new projects without needing to modify the |
@gnzlbg yeah I'd be down for that! (still in favor of modifying rustfmt) |
The plan is that we'll stop producing these files when we're confident that Rustfmt is not likely to screw up. I think we're almost there. I'd hoped to have a release for Rustfmt around now and change the default behviour then, but I found a pretty fundamental issue that needs a big fix :-( I'd be happy to change the default behaviour of You are correct that |
@nrc, @alexcrichton: I'm encountering the issue that motivated this issue report even today. Reading this thread, I'm not satisified the issue has been addressed. Running a bare @alexcrichton: Could you please share your experiences why you would want to be conservative with Metacargo fmt -- --version
cargo --version
|
@nrc @alexcrichton I think OTOH |
@nrc claimed above that these files won't be produced forever, and in the meantime it should be possible to add this to .gitignore fairly easily. @gnzlbg I'll leave that up to @nrc, he works more on rustfmt. |
Yes, I'm now adding It's only a single, low-impact addition to a default |
The plan is still to stop producing these files at some point (when we're confident we're not screwing up). I'm a bit less optimistic about when that might be now though. It might be that we produce them for the next year. In which case it seems worth adding to the .gitignore maybe? |
This is very offtopic, but couldn't we make these files opt-in? Given git
exists, they've always felt superfluous to me.
…On Wed, Feb 22, 2017 at 2:08 PM, Nick Cameron ***@***.***> wrote:
The plan is still to stop producing these files at some point (when we're
confident we're not screwing up). I'm a bit less optimistic about when that
might be now though. It might be that we produce them for the next year. In
which case it seems worth adding to the .gitignore maybe?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2409 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABsij-GELEUaD8dkDjQ6-9mEctuna4Lks5rfIefgaJpZM4HhBxy>
.
|
When I talk about whether we produce them or not I'm talking only about the defaults. Currently they are opt-out at some point we should change to being opt-in. |
We discussed this during tools triage yesterday and the conclusion was that let's just go ahead and add this to .gitignore. @sanmai-NL want to send a PR? |
@Amanieu: what do you wish, do you want to redo your PR or do you leave it to me? |
@sanmai-NL I'll leave it to you. |
Nice. I just wanted to add that, e.g., clang-format (which is already very old) still does require users to opt-into not emitting backup files, and I don't think that this behavior is ever going to change. One can feed the tool arbitrary broken code, and if it doesn't realize it, it can break that code even more (e.g. think of feeding it a half commented file) from a text editor while editing. So I think a "safe reformatting" utility in cargo still would be very useful (compile check -> format -> compile check) or even (build -> test -> format -> build -> test). |
…=alexcrichton Add `src/**/*.rs.bk` to VCS ignore file See #2409, specifically #2409 (comment). Also limit `target` exclusion to `target/` (dirs) as expected.
This will also avoid having
.bk
files published to crates.io.