Skip to content

Commit 5aa988d

Browse files
committed
remove unnecessary SHOW_FIX_DIFF flag
1 parent 99afcb7 commit 5aa988d

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

crates/ruff/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ pub fn check(args: CheckCommand, global_options: GlobalConfigArgs) -> Result<Exi
299299
let noqa = !cli.ignore_noqa;
300300
let mut printer_flags = PrinterFlags::empty();
301301
if !(cli.diff || fix_only) {
302-
printer_flags |= PrinterFlags::SHOW_VIOLATIONS | PrinterFlags::SHOW_FIX_DIFF;
302+
printer_flags |= PrinterFlags::SHOW_VIOLATIONS;
303303
}
304304
if show_fixes {
305305
printer_flags |= PrinterFlags::SHOW_FIX_SUMMARY;

crates/ruff/src/printer.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ bitflags! {
3131
const SHOW_VIOLATIONS = 1 << 0;
3232
/// Whether to show a summary of the fixed violations when emitting diagnostics.
3333
const SHOW_FIX_SUMMARY = 1 << 1;
34-
/// Whether to show a diff of each fixed violation when emitting diagnostics.
35-
const SHOW_FIX_DIFF = 1 << 2;
3634
}
3735
}
3836

@@ -261,11 +259,7 @@ impl Printer {
261259
OutputFormat::Concise | OutputFormat::Full => {
262260
TextEmitter::default()
263261
.with_show_fix_status(show_fix_status(self.fix_mode, fixables.as_ref()))
264-
.with_show_fix_diff(
265-
self.flags.intersects(Flags::SHOW_FIX_DIFF)
266-
&& self.format == OutputFormat::Full
267-
&& preview,
268-
)
262+
.with_show_fix_diff(self.format == OutputFormat::Full && preview)
269263
.with_show_source(self.format == OutputFormat::Full)
270264
.with_fix_applicability(self.unsafe_fixes.required_applicability())
271265
.with_preview(preview)

0 commit comments

Comments
 (0)