mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 06:42:02 +00:00
Respect --show-fixes
with --fix-only
(#3426)
This commit is contained in:
parent
952307d39d
commit
2383228709
1 changed files with 7 additions and 2 deletions
|
@ -171,6 +171,13 @@ impl Printer {
|
||||||
self.format,
|
self.format,
|
||||||
SerializationFormat::Text | SerializationFormat::Grouped
|
SerializationFormat::Text | SerializationFormat::Grouped
|
||||||
) {
|
) {
|
||||||
|
if self.flags.contains(Flags::SHOW_FIXES) {
|
||||||
|
if !diagnostics.fixed.is_empty() {
|
||||||
|
writeln!(stdout)?;
|
||||||
|
print_fixed(&mut stdout, &diagnostics.fixed)?;
|
||||||
|
writeln!(stdout)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
self.post_text(&mut stdout, diagnostics)?;
|
self.post_text(&mut stdout, diagnostics)?;
|
||||||
}
|
}
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
@ -292,7 +299,6 @@ impl Printer {
|
||||||
}
|
}
|
||||||
writeln!(stdout)?;
|
writeln!(stdout)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.flags.contains(Flags::SHOW_FIXES) {
|
if self.flags.contains(Flags::SHOW_FIXES) {
|
||||||
if !diagnostics.fixed.is_empty() {
|
if !diagnostics.fixed.is_empty() {
|
||||||
writeln!(stdout)?;
|
writeln!(stdout)?;
|
||||||
|
@ -300,7 +306,6 @@ impl Printer {
|
||||||
writeln!(stdout)?;
|
writeln!(stdout)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.post_text(&mut stdout, diagnostics)?;
|
self.post_text(&mut stdout, diagnostics)?;
|
||||||
}
|
}
|
||||||
SerializationFormat::Github => {
|
SerializationFormat::Github => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue