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

exit code is 0 on failed "ruff check --fix" #872

Open
minrk opened this issue Oct 30, 2024 · 1 comment
Open

exit code is 0 on failed "ruff check --fix" #872

minrk opened this issue Oct 30, 2024 · 1 comment

Comments

@minrk
Copy link
Contributor

minrk commented Oct 30, 2024

ruff check --fix may create some fixes that get normalized out in the actually_mutated check.

If the only fixable errors get normalized out such that mutated is True but actually_mutated is False, the output code is forced to 0, assuming that the present mutations are the only reason for the nonzero exit code, which may not be true, resulting in incorrectly successful hooks.

The only workaround I've figured out is to run it twice, once with --fix and again without.

@MarcoGorelli
Copy link
Collaborator

sure sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants