rust-lang/rustfix

How interactive should rustfix be?

Closed this issue · 4 comments

The current thinking is that we'll want rustfix to be entirely automatic by default, but that doesn't mean that we don't also want some level of user-interactivity. What's the right amount of user interactivity, how's it enabled, and how should it work?

There are multiple aspects here.

First, we should probably add some kind of progress indicator – fixing a crate compiles it two times and as we all know compiling stuff fast (even just cargo check) can take some time. I'd probably add the indicatif crate and define a few steps, like "gathering fixes", "applying fixes", "making sure it still compiles".

Second, we might want to add a --verbose mode, where we at least output filename and lines that were changed.

And last but not least, we could also bring back "old school rustfix" which asks for each suggestion.

That all sounds great to me!

For large projects, I think it might be good to have a way to do one or both of the following:

  • Start in "old school" ask-for-each-suggestion mode, then permit switching to "full automatic" mode once the user is confident that the fixes are consistently appropriate.
  • Once a particular lint has been generated 1 (or n) suggestion(s) and the user has confirmed them, automatically apply all further lints of that type.

This would permit users to get a feel for what rustfix is doing (and to determine for themselves whether they trust it) without needing to spend hours babysitting a conversion process for a large (million+ line) project.

Ok cargo fix is now present in Cargo itself, and it's the same design as before. I think for now we're in a good enough state for the 2018 edition, and I think it's safe to consider this a "feature request" in that I won't move it over to the Cargo repo