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

Fix exit code for commands terminated by signals #2971

Merged
merged 1 commit into from Aug 22, 2023

Conversation

chriskuehl
Copy link
Member

Fixes #2970

Comment on lines -173 to +174
retcode = max(retcode, proc_retcode)
if abs(proc_retcode) > abs(retcode):
retcode = proc_retcode
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used this over something like retcode = retcode or proc_retcode just so that it would consistently pick the same exit status from a set of exit statuses. If you prefer some other way of selecting which to use, I can change it to that.

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asottile asottile merged commit 0c3d605 into pre-commit:main Aug 22, 2023
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

pre-commit treats hook commands dying due to POSIX signal as successful
2 participants