From 6b7a738825a5268590fbf4e9724930734d326f32 Mon Sep 17 00:00:00 2001 From: Simon Brugman Date: Thu, 17 Oct 2024 08:02:00 +0200 Subject: [PATCH] Add explanation of fixable in `--statistics` command (#13774) Co-authored-by: Micha Reiser --- crates/ruff/src/printer.rs | 4 ++++ crates/ruff/tests/integration_test.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/crates/ruff/src/printer.rs b/crates/ruff/src/printer.rs index e44c599bc1020..4982a8e5097ee 100644 --- a/crates/ruff/src/printer.rs +++ b/crates/ruff/src/printer.rs @@ -417,6 +417,10 @@ impl Printer { statistic.name, )?; } + + if any_fixable { + writeln!(writer, "[*] fixable with `ruff check --fix`",)?; + } return Ok(()); } OutputFormat::Json => { diff --git a/crates/ruff/tests/integration_test.rs b/crates/ruff/tests/integration_test.rs index 05680f89be66b..99ed3a74a28e5 100644 --- a/crates/ruff/tests/integration_test.rs +++ b/crates/ruff/tests/integration_test.rs @@ -979,6 +979,7 @@ fn show_statistics() { exit_code: 1 ----- stdout ----- 1 F401 [*] unused-import + [*] fixable with `ruff check --fix` ----- stderr ----- "###);