-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Return separate error codes for fixable vs. non-fixable errors. #930
Comments
Isn't fact, that errors are fixable reflected in report itself? |
Exit code If there a reason you can't just read an error report, or use a custom report that outputs whatever values you want ( Here is an example report used for a SublimeText plugin. It prints a special header message if there are fixable errors in the file: https://github.com/squizlabs/sublime-PHP_CodeSniffer/blob/master/STPluginReport.php |
I don't care much about which exit code is used; The use-case is for a wrapper script that asks the user if they want to call phpcbf to fix the errors reported, if there are any. This is a minor issue, but would be nice to have. |
Thinking about this again, exit code 3 makes no sense - feels like a bolt-on hack. It's going to be nicer to use the following codes:
So I'll target this for 3.0 and do a BC break with everything else I'm breaking over there. |
…tween fixable and non-fiable errors (request #930) The meaning of codes is now: 0: no coding standard errors found 1: coding standard errors found, but none are fixable 2: fixable coding standard errors found 3: script processing error
At the moment, phpcs returns with an exit code of
0
when no errors or warnings are found, and a1
if there are any errors or warnings. The exit code is the same regardless of whether the errors are fixable or not.It would be nice if phpcs would return an exit code of
2
when one or more of the encountered errors or warnings were fixable by phpcbf.The text was updated successfully, but these errors were encountered: