-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
No, we should fail there but currently don't |
This might cause issues with |
@konstin, by "fail", do you specifically mean that we should be exiting with a non-zero exit code? And perhaps continuing to have nothing dumped to |
yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@konstin this seems very simple, my only thought is maybe we should have a different message that's in a different format so it's obviously distinct e.g. "No errors found" (I don't love exact message that since it sounds like an error)
@charliermarsh any ideas?
I'd also like to say how many files we scanned e.g. "Found 0 errors in 125 files" would be helpful to know it actually scanned something. We can track that separately.
Slight preference for something like "All checks passed" over something that contains the word error, otherwise i'm on board. |
I like "All checks passed" although it's a little outside our normal terminology |
# Conflicts: # crates/ruff_cli/tests/integration_test.rs
|
I'm not sure what to say here. A configuration option for this seems excessive and it is significantly friendlier for Ruff to indicate that it did something. If you want to open an issue requesting a configuration option, we can consider it. I'd want to see significant community feedback that this is important first though. |
Sorry, I figured out that |
Oh great! :) |
https://github.com/aspect-build/rules_lint/blob/main/docs/lint_test.md is one such tool. It is used by Bazel users to assert "no warnings were produced by the tool". So this change broke our tests. From what I can tell, ruff is the only linter we integrate that prints on success.
Here's some other linter decisions on this:
So I think rather than add an option, ruff should go back to the old silent-on-success behavior. |
@alexeagle would you mind creating a new issue for this to avoid having discussions on merged PRs. Thank you I wonder if it would be sufficient to test if Ruff's in an interactive terminal and only then print the message. |
@MichaReiser thanks for the quick reply, since the issue requesting this change is still open, I've just commented there: #8553 (comment) |
Thanks for moving the discussion! |
Summary
Adds a successful check message after no errors were found
Implements #8553
Test Plan
Ran a check on a test file with
cargo run -p ruff_cli -- check test.py --no-cache
and outputted as expected.Ran the same check with
cargo run -p ruff_cli -- check test.py --no-cache --silent
and the command was gone as expected.