-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Revise exit codes for PHPCS and PHPCBF commands #2898
Comments
Loosely related open issues:
|
Param |
Is there any documentation somewhere that lists all non Today was the first time I discovered an exit code of |
@dfelton I think this is what you are looking for: #930 (comment) |
phpcbf exits with a failure exit code if there were any violations, even if they could all be fixed. This makes it useless in a lint-staged pipeline (which expects scripts to exit successfully, and will otherwise discard all changes and abort the commit), so wrap phpcbf in a small shell script checking the exit code and ignoring a 1 exit code. (Exit code 2 would mean that there were some errors that could not be fixed.) We can hopefully revert this when PHP_CodeSniffer version 4 is released, which is supposed to change the exit codes to make them more sensible (squizlabs/PHP_CodeSniffer#2898). Change-Id: Ida87fd259bd7cc1b6c0f789001a574865e435472
* Update EntitySchema from branch 'master' to 6abfcffed6c333a9cac3f9e9986b53a3a84ec45e - Fix phpcbf exit code for lint-staged phpcbf exits with a failure exit code if there were any violations, even if they could all be fixed. This makes it useless in a lint-staged pipeline (which expects scripts to exit successfully, and will otherwise discard all changes and abort the commit), so wrap phpcbf in a small shell script checking the exit code and ignoring a 1 exit code. (Exit code 2 would mean that there were some errors that could not be fixed.) We can hopefully revert this when PHP_CodeSniffer version 4 is released, which is supposed to change the exit codes to make them more sensible (squizlabs/PHP_CodeSniffer#2898). Change-Id: Ida87fd259bd7cc1b6c0f789001a574865e435472
Version 4 is a good time to review the exit codes that both scripts produce to ensure that success cases all use
0
and that all failure cases have codes that make sense. Documentation in the wiki to describe the new exist codes should be an output of this work.The text was updated successfully, but these errors were encountered: