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

Distinct exit codes for the various error cases #1601

Merged
merged 1 commit into from Oct 28, 2020

Conversation

bozhodimitrov
Copy link
Contributor

@bozhodimitrov bozhodimitrov commented Sep 16, 2020

This PR attempts to follow the Linux/Bash convention for exit codes. See more at Exit Codes With Special Meanings (You might need to use the Google web cache, because the resource seems to be down right now).

Basically we will have the following:

  • 1 for standard error
  • 130 for interrupted process by user
  • 3 for any unexpected error

Bash/GNU examples which return exit code 130:

tail -f /dev/null
# press Ctrl + C
echo $?
# 130

sleep 42
# press Ctrl + C
echo $?
# 130

@bozhodimitrov
Copy link
Contributor Author

bozhodimitrov commented Sep 16, 2020

Windows CI pipeline takes ages to complete 🎃 (30+ minutes)

PS: Additional documentation might be required.

exc: BaseException,
formatted: str,
msg: str,
returncode: int,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the name of this argument in order to be consistent with the rest of the codebase.
For example: pre-commit: returncode occurrences

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 a0c0870 into pre-commit:master Oct 28, 2020
@bozhodimitrov bozhodimitrov deleted the distinct_exit_codes branch December 15, 2020 17:38
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.

None yet

4 participants