Skip to content

Commit

Permalink
Remove "additional" when no errors are fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Oct 6, 2023
1 parent 602e16f commit 29e210b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crates/ruff_cli/src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,15 @@ impl Printer {

if unapplied > 0 {
let es = if unapplied == 1 { "" } else { "es" };
let omitted =
format!("({unapplied} additional fix{es} available with `--unsafe-fixes`)");
if fixed > 0 {
let s = if fixed == 1 { "" } else { "s" };
if self.fix_mode.is_apply() {
writeln!(writer, "Fixed {fixed} error{s} {omitted}.")?;
writeln!(writer, "Fixed {fixed} error{s} ({unapplied} additional fix{es} available with `--unsafe-fixes`).")?;
} else {
writeln!(writer, "Would fix {fixed} error{s} {omitted}.")?;
writeln!(writer, "Would fix {fixed} error{s} ({unapplied} additional fix{es} available with `--unsafe-fixes`).")?;
}
} else {
writeln!(writer, "No errors fixed {omitted}.")?;
writeln!(writer, "No errors fixed ({unapplied} fix{es} available with `--unsafe-fixes`).")?;
}
} else {
if fixed > 0 {
Expand Down

0 comments on commit 29e210b

Please sign in to comment.