-
Notifications
You must be signed in to change notification settings - Fork 879
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
Indicate successful check #8553
Comments
I'm into a message if there are no errors and indicating the number of number of source files sounds nice. I'd prefer not to include an emoji. |
I presume those that prefer that approach could still achieve it with the |
This implements outputting a message to `stdout` when a check is run and errors do not occur and fixes are not made. See astral-sh#8553 for more information.
This implements outputting a message to `stdout` when a check is run and errors do not occur and fixes are not made. See astral-sh#8553 for more information.
is this issue still available ? I would like to give it a go and implement a nice message output for successful checks. I got inspired from |
Well it's not done but there are a couple existing pull requests @hughhan1 opened a pull request but noted that @vinhocent had a better pull request. @konstin reviewed the latter one. I'm not sure what the status is. I'd love to have this done soon though! |
I kinda have an idea to also add the checked files to the diagnostics in order to display to the user how many files where checked after a successful run. Will make a PR and maybe you guys take a look. |
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary Adds a successful check message after no errors were found Implements #8553 <!-- What's the purpose of the change? What does it do, and why? --> ## 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. <!-- How was it tested? --> --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
I think that users who are trying Ruff for the first time, can't believe the speed and want to see that Ruff is actually doing something are well-advised to introduce a lint violation and see that it's reported, as a way of learning the tool. #8631 introduced output on success. This has been discussed with other linters:
There are tools which interpret non-empty output to mean that a developers attention is required, and empty output to mean the linter has nothing to report. For example in CI it might report your one-line "success" message as spam boxes in the results UI, where no output would have created no box. I think rather than add an option, ruff should go back to the old silent-on-success behavior. |
Simply, I disagree. I understand the Unix philosophy and agree with it in many cases, but I don't really see this as a friendly default interface which is an emphasized goal in our tooling. You should be able to suppress this with I'm willing to hear more discussion and feedback.
This is the purpose of exit codes. Is there a reason that's insufficient? Deprecation warnings? |
I think exit codes don't express warnings well. Non zero exit code would terminate a build, which is an error semantic. |
Yeah I think there's an open question about how to elevate warnings to users. Most users don't see any of the deprecation warnings we display in CI and are surprised when things break. |
Note we write this to stdout and not stderr (which is where we emit things like warnings) |
Two of the five testimonials in the README mention intentionally introducing errors to be sure ruff was even running. I admit I did the same when I first tried ruff. It's cool that ruff is so fast people aren't sure it ran at all, but perhaps it is also a UX problem?
When black finds nothing to complain about, it says:
pylint:
mypy:
Perhaps ruff could do something similar if no errors are found? For example:
On the other hand, several linters are silent if they find nothing (pycodestyle, flake8, isort, etc.).
The text was updated successfully, but these errors were encountered: