PHP_CodeSniffer
PHP_CodeSniffer copied to clipboard
4.0 | Revise exit codes for PHPCS and PHPCBF commands
Repost from https://github.com/squizlabs/PHP_CodeSniffer/issues/2898 by @gsherwood:
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.
Additional info posted by @jrfnl:
Loosely related open issues:
- squizlabs/PHP_CodeSniffer#1818
- squizlabs/PHP_CodeSniffer#2412 (discoverability of availability of exit code related CLI arguments)
And some related closed issues:
- https://github.com/squizlabs/PHP_CodeSniffer/issues/2954
- https://github.com/squizlabs/PHP_CodeSniffer/issues/3057
- https://github.com/squizlabs/PHP_CodeSniffer/issues/3367
- https://github.com/squizlabs/PHP_CodeSniffer/pull/3541
And the following open PR is also related:
- https://github.com/squizlabs/PHP_CodeSniffer/pull/3696
Related remark posted by @nelson6e65:
Param
--runtime-set ignore_warnings_on_exit 1
works onphpcs
, but it does not forphpcbf
.
Question by @dfelton:
Is there any documentation somewhere that lists all non
0
or1
exit codes that exist, and the meaning of them?Today was the first time I discovered an exit code of
3
is used for when and invalid standard is given. It'd be nice to be able to read a compiled list of what exit codes there are, and I cannot seem to find any information on the wiki on this topic.
Reply by @jrfnl:
I think this is what you are looking for: https://github.com/squizlabs/PHP_CodeSniffer/issues/930#issuecomment-229562566