mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 22:31:47 +00:00
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:
parent
e7316c1cc6
commit
732b0405d7
5 changed files with 46 additions and 59 deletions
|
@ -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<()> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue