-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
--fix-only
returns exit code 1 upon fixes
#4092
Comments
Would |
@JonathanPlasse it does exactly the opposite. I was looking for a |
I assumed that if you run Ruff in that scenario with |
No, it doesn't: venv:(***)$ ~/programming/*** git:(main) ✗
stephanos@marco $ ruff --fix-only foo.py
Fixed 1 error.
venv:(***)$ ~/programming/*** git:(main) ✗
stephanos@marco $ echo $?
1 |
Ahh ok, that strikes me as a bug, but will look into it. |
I guess, in this framing, |
Thank you for the great work! Ruff is fantastic, and I have replaced all my linters with it. I just have a small feature request on the fixers of it.
Now, the cli options to fix the ruff issues are:
ruff --fix .
andruff --fix-only .
They are a bit problematic to work with in scripts, as even if they fix all the issues that are fixable, the exit code can be zero, if there are no fixable issues. There is the obvious workaround of adding|| true
, but this will mask all errors, for example ruff itself panicking instead of fixing the fixable issues. A new option that would allow just run it in fix mode.The text was updated successfully, but these errors were encountered: