rust-lang/rustfix

Dry-run functionality

ozkriff opened this issue · 10 comments

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.

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?

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

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

Closing in favor of rust-lang/cargo#6040.