From babf0a7739ca63110b52cd7639dee6a18e31a3c4 Mon Sep 17 00:00:00 2001 From: Tri Ho Date: Sun, 12 Nov 2023 02:57:36 -0500 Subject: [PATCH 1/3] added 0 errors message --- crates/ruff_cli/src/printer.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ruff_cli/src/printer.rs b/crates/ruff_cli/src/printer.rs index 6f22f37d1608e..2ef2189e029c8 100644 --- a/crates/ruff_cli/src/printer.rs +++ b/crates/ruff_cli/src/printer.rs @@ -120,6 +120,8 @@ impl Printer { } else if remaining > 0 { let s = if remaining == 1 { "" } else { "s" }; writeln!(writer, "Found {remaining} error{s}.")?; + } else if remaining == 0 { + writeln!(writer, "Found 0 errors.")?; } if let Some(fixables) = fixables { From c1896e354fd488ddb53bb501ff6009f15fafa745 Mon Sep 17 00:00:00 2001 From: Tri Ho Date: Sun, 12 Nov 2023 13:18:53 -0500 Subject: [PATCH 2/3] added unit test changes --- crates/ruff_cli/tests/integration_test.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ruff_cli/tests/integration_test.rs b/crates/ruff_cli/tests/integration_test.rs index 59c372aac1806..894160634b653 100644 --- a/crates/ruff_cli/tests/integration_test.rs +++ b/crates/ruff_cli/tests/integration_test.rs @@ -36,6 +36,7 @@ fn stdin_success() { success: true exit_code: 0 ----- stdout ----- + Found 0 errors. ----- stderr ----- "###); @@ -103,6 +104,7 @@ fn stdin_source_type_pyi() { success: true exit_code: 0 ----- stdout ----- + Found 0 errors. ----- stderr ----- "###); @@ -470,6 +472,7 @@ fn stdin_fix_when_no_issues_should_still_print_contents() { print(sys.version) ----- stderr ----- + Found 0 errors. "###); } @@ -829,6 +832,7 @@ fn preview_disabled_direct() { success: true exit_code: 0 ----- stdout ----- + Found 0 errors. ----- stderr ----- warning: Selection `FURB145` has no effect because the `--preview` flag was not included. @@ -846,6 +850,7 @@ fn preview_disabled_prefix_empty() { success: true exit_code: 0 ----- stdout ----- + Found 0 errors. ----- stderr ----- warning: Selection `CPY` has no effect because the `--preview` flag was not included. @@ -1600,6 +1605,7 @@ def log(x, base) -> float: success: true exit_code: 0 ----- stdout ----- + Found 0 errors. ----- stderr ----- "### From 304c8be45cc26b06a685ec6c41289d2bd6a122f1 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 13 Mar 2024 13:56:17 -0500 Subject: [PATCH 3/3] Change message --- crates/ruff_cli/src/printer.rs | 2 +- crates/ruff_cli/tests/integration_test.rs | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/ruff_cli/src/printer.rs b/crates/ruff_cli/src/printer.rs index 2ef2189e029c8..75c6dfa03fc3e 100644 --- a/crates/ruff_cli/src/printer.rs +++ b/crates/ruff_cli/src/printer.rs @@ -121,7 +121,7 @@ impl Printer { let s = if remaining == 1 { "" } else { "s" }; writeln!(writer, "Found {remaining} error{s}.")?; } else if remaining == 0 { - writeln!(writer, "Found 0 errors.")?; + writeln!(writer, "All checks passed!")?; } if let Some(fixables) = fixables { diff --git a/crates/ruff_cli/tests/integration_test.rs b/crates/ruff_cli/tests/integration_test.rs index 894160634b653..0993b6d1b7d46 100644 --- a/crates/ruff_cli/tests/integration_test.rs +++ b/crates/ruff_cli/tests/integration_test.rs @@ -36,7 +36,7 @@ fn stdin_success() { success: true exit_code: 0 ----- stdout ----- - Found 0 errors. + All checks passed! ----- stderr ----- "###); @@ -104,7 +104,7 @@ fn stdin_source_type_pyi() { success: true exit_code: 0 ----- stdout ----- - Found 0 errors. + All checks passed! ----- stderr ----- "###); @@ -472,7 +472,7 @@ fn stdin_fix_when_no_issues_should_still_print_contents() { print(sys.version) ----- stderr ----- - Found 0 errors. + All checks passed! "###); } @@ -832,7 +832,7 @@ fn preview_disabled_direct() { success: true exit_code: 0 ----- stdout ----- - Found 0 errors. + All checks passed! ----- stderr ----- warning: Selection `FURB145` has no effect because the `--preview` flag was not included. @@ -850,7 +850,7 @@ fn preview_disabled_prefix_empty() { success: true exit_code: 0 ----- stdout ----- - Found 0 errors. + All checks passed! ----- stderr ----- warning: Selection `CPY` has no effect because the `--preview` flag was not included. @@ -976,6 +976,7 @@ fn unreadable_dir() -> Result<()> { success: true exit_code: 0 ----- stdout ----- + All checks passed! ----- stderr ----- warning: Encountered error: Permission denied (os error 13) @@ -1605,7 +1606,7 @@ def log(x, base) -> float: success: true exit_code: 0 ----- stdout ----- - Found 0 errors. + All checks passed! ----- stderr ----- "###