Skip to content

Distinct exit codes for the various error cases#1601

Merged
asottile merged 1 commit intopre-commit:masterfrom
bozhodimitrov:distinct_exit_codes
Oct 28, 2020
Merged

Distinct exit codes for the various error cases#1601
asottile merged 1 commit intopre-commit:masterfrom
bozhodimitrov:distinct_exit_codes

Conversation

@bozhodimitrov
Copy link
Copy Markdown

@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
Copy Markdown
Author

bozhodimitrov commented Sep 16, 2020

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

PS: Additional documentation might be required.

pass


def _log_and_exit(
Copy link
Copy Markdown
Author

@bozhodimitrov bozhodimitrov Sep 24, 2020

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
Copy Markdown
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.

4 participants