Open
Description
Problem
In a project which uses rustfmt, running cargo fix
sometimes leaves the source files with non-canonical formatting (e.g. around removed imports), which can be surprising (especially if one is using editor format-on-save) and is an extra step to fix.
Proposed Solution
Add a configurable setting which causes cargo fix
to also have the effect of cargo fmt
after applying fixes.
This should be a setting, not solely a command-line flag, so that it is automatic and convenient for projects which choose to use rustfmt — contributors won't have to remember to type it.
It might make sense to frame the setting as a general “autoformat” rather than specific to cargo fix
, in case any future commands also edit source code and should have the same behavior.