From 1ccdf429932f9f6db95a8a692dc227fa6e0004bb Mon Sep 17 00:00:00 2001 From: Simon Brugman Date: Wed, 16 Oct 2024 12:56:16 +0200 Subject: [PATCH 1/3] Fix for #13717 --- crates/ruff/src/printer.rs | 7 +++++++ crates/ruff/tests/integration_test.rs | 1 + 2 files changed, 8 insertions(+) diff --git a/crates/ruff/src/printer.rs b/crates/ruff/src/printer.rs index e44c599bc1020..131f4a65fe5d8 100644 --- a/crates/ruff/src/printer.rs +++ b/crates/ruff/src/printer.rs @@ -417,6 +417,13 @@ impl Printer { statistic.name, )?; } + + if any_fixable { + writeln!( + writer, + "[*] indicates that a violation is fixable with the `--fix` option." + )?; + } return Ok(()); } OutputFormat::Json => { diff --git a/crates/ruff/tests/integration_test.rs b/crates/ruff/tests/integration_test.rs index fae9b4be2397b..d6144634df628 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 + [*] indicates that a violation is fixable with the `--fix` option. ----- stderr ----- "###); From 848f7dd8109a8ab1b47221ce2172d27df6ca8cff Mon Sep 17 00:00:00 2001 From: Simon Brugman Date: Wed, 16 Oct 2024 16:35:08 +0200 Subject: [PATCH 2/3] Incorporate suggesiton Co-authored-by: Micha Reiser --- crates/ruff/src/printer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff/src/printer.rs b/crates/ruff/src/printer.rs index 131f4a65fe5d8..394873c6a70b0 100644 --- a/crates/ruff/src/printer.rs +++ b/crates/ruff/src/printer.rs @@ -421,7 +421,7 @@ impl Printer { if any_fixable { writeln!( writer, - "[*] indicates that a violation is fixable with the `--fix` option." + "[*] fixable with `ruff check --fix` )?; } return Ok(()); From d9f223cfd4de611753ca2f29df3f644d39a320aa Mon Sep 17 00:00:00 2001 From: Simon Brugman Date: Wed, 16 Oct 2024 16:39:46 +0200 Subject: [PATCH 3/3] Update test --- crates/ruff/src/printer.rs | 5 +---- crates/ruff/tests/integration_test.rs | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/ruff/src/printer.rs b/crates/ruff/src/printer.rs index 394873c6a70b0..4982a8e5097ee 100644 --- a/crates/ruff/src/printer.rs +++ b/crates/ruff/src/printer.rs @@ -419,10 +419,7 @@ impl Printer { } if any_fixable { - writeln!( - writer, - "[*] fixable with `ruff check --fix` - )?; + writeln!(writer, "[*] fixable with `ruff check --fix`",)?; } return Ok(()); } diff --git a/crates/ruff/tests/integration_test.rs b/crates/ruff/tests/integration_test.rs index d6144634df628..f45b7f5db0f63 100644 --- a/crates/ruff/tests/integration_test.rs +++ b/crates/ruff/tests/integration_test.rs @@ -979,7 +979,7 @@ fn show_statistics() { exit_code: 1 ----- stdout ----- 1 F401 [*] unused-import - [*] indicates that a violation is fixable with the `--fix` option. + [*] fixable with `ruff check --fix` ----- stderr ----- "###);