Remove FixMode::None (#5087)

## Summary

We now _always_ generate fixes, so `FixMode::None` and
`FixMode::Generate` are redundant. We can also remove the TODO around
`--fix-dry-run`, since that's our default behavior.

Closes #5081.
This commit is contained in:
Charlie Marsh 2023-06-14 11:17:09 -04:00 committed by GitHub
parent e7316c1cc6
commit 732b0405d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 59 deletions

View file

@ -141,9 +141,9 @@ impl Printer {
.sum::<usize>();
if fixed > 0 {
let s = if fixed == 1 { "" } else { "s" };
if matches!(self.autofix_level, flags::FixMode::Apply) {
if self.autofix_level.is_apply() {
writeln!(stdout, "Fixed {fixed} error{s}.")?;
} else if matches!(self.autofix_level, flags::FixMode::Diff) {
} else {
writeln!(stdout, "Would fix {fixed} error{s}.")?;
}
}
@ -391,7 +391,7 @@ const fn show_fix_status(autofix_level: flags::FixMode) -> bool {
// this pass! (We're occasionally unable to determine whether a specific
// violation is fixable without trying to fix it, so if autofix is not
// enabled, we may inadvertently indicate that a rule is fixable.)
!matches!(autofix_level, flags::FixMode::Apply)
!autofix_level.is_apply()
}
fn print_fix_summary<T: Write>(stdout: &mut T, fixed: &FxHashMap<String, FixTable>) -> Result<()> {