Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicated Successful Check #8631

Merged
merged 4 commits into from Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/ruff/src/printer.rs
Expand Up @@ -118,6 +118,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, "All checks passed!")?;
}

if let Some(fixables) = fixables {
Expand Down
12 changes: 12 additions & 0 deletions crates/ruff/tests/integration_test.rs
Expand Up @@ -101,6 +101,7 @@ fn stdin_success() {
success: true
exit_code: 0
----- stdout -----
All checks passed!

----- stderr -----
"###);
Expand Down Expand Up @@ -222,6 +223,7 @@ fn stdin_source_type_pyi() {
success: true
exit_code: 0
----- stdout -----
All checks passed!

----- stderr -----
"###);
Expand Down Expand Up @@ -590,6 +592,7 @@ fn stdin_fix_when_no_issues_should_still_print_contents() {
print(sys.version)

----- stderr -----
All checks passed!
"###);
}

Expand Down Expand Up @@ -1023,6 +1026,7 @@ fn preview_disabled_direct() {
success: true
exit_code: 0
----- stdout -----
All checks passed!

----- stderr -----
warning: Selection `RUF911` has no effect because preview is not enabled.
Expand All @@ -1039,6 +1043,7 @@ fn preview_disabled_prefix_empty() {
success: true
exit_code: 0
----- stdout -----
All checks passed!

----- stderr -----
warning: Selection `RUF91` has no effect because preview is not enabled.
Expand All @@ -1055,6 +1060,7 @@ fn preview_disabled_does_not_warn_for_empty_ignore_selections() {
success: true
exit_code: 0
----- stdout -----
All checks passed!

----- stderr -----
"###);
Expand All @@ -1070,6 +1076,7 @@ fn preview_disabled_does_not_warn_for_empty_fixable_selections() {
success: true
exit_code: 0
----- stdout -----
All checks passed!

----- stderr -----
"###);
Expand Down Expand Up @@ -1175,6 +1182,7 @@ fn removed_indirect() {
success: true
exit_code: 0
----- stdout -----
All checks passed!

----- stderr -----
"###);
Expand Down Expand Up @@ -1205,6 +1213,7 @@ fn redirect_indirect() {
success: true
exit_code: 0
----- stdout -----
All checks passed!

----- stderr -----
"###);
Expand Down Expand Up @@ -1307,6 +1316,7 @@ fn deprecated_indirect_preview_enabled() {
success: true
exit_code: 0
----- stdout -----
All checks passed!

----- stderr -----
"###);
Expand Down Expand Up @@ -1383,6 +1393,7 @@ fn unreadable_dir() -> Result<()> {
success: true
exit_code: 0
----- stdout -----
All checks passed!

----- stderr -----
warning: Encountered error: Permission denied (os error 13)
Expand Down Expand Up @@ -1897,6 +1908,7 @@ def log(x, base) -> float:
success: true
exit_code: 0
----- stdout -----
All checks passed!

----- stderr -----
"###
Expand Down
2 changes: 2 additions & 0 deletions crates/ruff/tests/lint.rs
Expand Up @@ -496,6 +496,7 @@ ignore = ["D203", "D212"]
success: true
exit_code: 0
----- stdout -----
All checks passed!

----- stderr -----
warning: No Python files found under the given path(s)
Expand Down Expand Up @@ -833,6 +834,7 @@ fn complex_config_setting_overridden_via_cli() -> Result<()> {
success: true
exit_code: 0
----- stdout -----
All checks passed!

----- stderr -----
"###);
Expand Down