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

Return non-zero exit codes #102

Open
jyggen opened this issue Feb 20, 2017 · 3 comments
Open

Return non-zero exit codes #102

jyggen opened this issue Feb 20, 2017 · 3 comments

Comments

@jyggen
Copy link

jyggen commented Feb 20, 2017

Currently php7cc returns 0 regardless of number of errors detected which makes it hard to integrate into build processes. Preferably php7cc should return something else when warnings and errors occur :)

@sstalle
Copy link
Owner

sstalle commented Feb 20, 2017

You are perfectly right. Unfortunately this behaviour cannot be changed in 1.x branch, because that would be a major BC break. And I don't have the resources to work on 2.0 now, so it probably won't be fixed for quite some time.

@maglnet
Copy link

maglnet commented Dec 7, 2017

Another possibility without having a bc break would be adding a new parameter like --fail-on-error and only return an error code if this is set.

I'm currently using this approach (not the best, but helps with failing) :-)

php php7cc.phar ./src -o json > result.json
php -r "exit(count(json_decode(file_get_contents(__DIR__ . '/result.json'), true)['files']));"

@fulldecent
Copy link

Please tag issue v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants