CLI: Show `--fix`ed and fixable issues too?
I think it would be useful if the CLI listed the things it --fixes, or can fix; right now you get something like
Found 8 error(s).
1 potentially fixable with the --fix option.
and if you run --fix, you'll get one error less and need look at the changes that have been applied and then figure out why. Instead, I think it'd be nicer if the flow was
$ ruff .
file.py:2:9: NOM001 Ran out of pancakes in `__init__` (fixable)
Found 1 error(s).
1 potentially fixable with the --fix option.
$ ruff --fix .
file.py:2:9: NOM001 Ran out of pancakes in `__init__` (fixed)
Found 1 error(s).
1 fixed with the --fix option.
$
I disagree ... I think it's better to follow the "rule of silence" from the Unix philosophy (1,2):
When a program has nothing surprising to say, it should say nothing.
(Besides any self-respecting programmer uses version control and will be able to see the fixes in detail by doing e.g. a git diff.)
So I'd rather keep the current default behavior. However I'd be alright with showing this output when a --verbose flag is supplied ... however in order to do that we'd probably have to firstly rename our current --verbose flag to debug ... which would be more fitting anyway since it currently literally prints [DEBUG] messages that are completely uninteresting for regular users.
I actually made a change in #1701, a while ago, to include the list of fixes in a slightly different format (just telling you how many violations were fixed in each file, closer to Black's output, where it tells you which files are reformatted). But I was worried it was too verbose and wanted to get more feedback before sending it out (so it was reverted in #1711).
How about --show-fixes instead of --verbose?
I don't think this is important enough to warrant a dedicated command-line flag ... every flag we add complicates the UI a bit and makes it harder to for the user to find the flags they're actually looking for.
I just opened #2188 for the larger issue of -v being user-unfriendly.
My 2cent: We call ruff --fix from pre-commit - I'd love to see a hint of what was changed to have a closer look. It is not always obvious when just a single line has new changes.
The --show-fixes flag exists which helps with this a bit.
Ah, great, thank you. This is close enough.
Actually gonna close this because I think --show-fixes helped enough.