-
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
CLI: Show fixes by default in ruff check
#7352
Comments
I came here from #8677 because I wanted a non-zero exit code when there are things to be fixed in my source code (even if Ruff can't fix them). Based on the description of this issue, I don't understand the details but I get the impression it will somehow eliminate the need for |
I'm honestly not sure... this is different than |
A note regarding the implementation.. we probably need to gate this with preview to match #7349 |
If this has no effect on exit code, I feel that the comments in the tickets concerning exit codes that are linking here (#4093 (comment), #8677 (comment), #8584 (comment)) are confusing. I'm not a native speaker, but to me, all those tickets were filed because the user was expecting a non-zero exit code when Ruff is unhappy. I think part of the reason people are surprised is because it's so easy to get the non-zero exit code with Since this ticket does not help with exit codes, should the non-zero exit code part of this issue be dealt with by #8677? |
Ah I see what you're saying:
Yes this should address your use-case, in that:
|
Requires #7350 for opt-out of display.
ruff check
should display fixes that Ruff can apply. Currently this is only possible for the whole file with--diff
.Some fixes may modify content across a file, e.g. when renaming a binding. We should limit the display of fixes to roughly match the range of source context displayed (#7349). If we do not display the entire fix, we should include a notice of the number of additional lines that will be modified if the fix is applied. Naively, we may be able to implement this by only selecting a portion of the fix. In a more comprehensive implementation, we may need to add a new diagnostic range attribute for this display and address it in each problem case.
The text was updated successfully, but these errors were encountered: