rustfix
rustfix copied to clipboard
Dry-run functionality
Is something like --dry-run planned? Or rustfix will always require a VCS?
I'm not sure I understand. What would --dry-run do? Not change the files? Isn't that basically the same as doing cargo check instead of cargo fix, then?
Oh, and depending on your answer, this seems like an issue better suited for the cargo repository, as the cargo fix tool lives there (cf. https://github.com/rust-lang/cargo/issues?utf8=✓&q=is%3Aissue+label%3ACommand-fix+). This repo only contains the rustfix library.
It would print out a diff of what it would change. with cargo check you still have to wonder about which suggestions would get applied, and how
On Mon, Sep 17, 2018, 5:22 PM Pascal Hertleif [email protected] wrote:
I'm not sure I understand. What would --dry-run do? Not change the files? Isn't that basically the same as doing cargo check instead of cargo fix, then?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rust-lang-nursery/rustfix/issues/146#issuecomment-421983195, or mute the thread https://github.com/notifications/unsubscribe-auth/ABivSI-MvL3FDHxMG1b4KSWp_zJXzKEiks5ub4zqgaJpZM4WrsnG .
From the 1.29 blog post:
The compiler has an API for this, and it only suggests fixing lints that we’re confident recommend correct code.
As far as I understand, not all warnings showed by cargo check are fixed by rustfix.
Ah, I see, writing the diff is an interesting idea. In theory you can write it to a .patch file, too, then.
Do you want to open this issue on the cargo repo, @ozkriff? Otherwise I can do it (but you probably have some concrete idea and use cases you could describe, too).
Do you want to open this issue on the cargo repo, @ozkriff?
:+1: Will do in a few minutes.
you probably have some concrete idea and use cases you could describe
Actually, no, I was just asked about this in the comments to russian translation of 1.29 announcement.
Done: https://github.com/rust-lang/cargo/issues/6040
I think this library will also need support for doing all this without editing, no?
@Manishearth nah, all file handling is done in the cargo subcommand