-
Notifications
You must be signed in to change notification settings - Fork 383
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
Add lint:php:fix script #2111
Comments
Seems to work fine for me: $ vendor/bin/phpcbf
No fixable errors were found
Time: 1 mins, 17.99 secs; Memory: 62MB
$ echo $?
0 |
When it actually fixed an error then it returned an error code. Running it a second time when there was nothing fixed rested in a success error code. Looks like we just need to do a check for the expected success error code and return it to NPM instead. See squizlabs/PHP_CodeSniffer#1359 |
I tried to do something like this:
But then you can't run something like If we'd want to run this on CI or as a pre-commit hook, then we should perhaps instead try keeping |
@swissspidy I added a little wrapper Bash script to deal with this. |
In the
amp-stories-redux
branch there is alint:js:fix
script and alint:css:fix
script. There should be one for PHP as well:I tried this but it the
phpcbf
command unexpectedly returned a failure code even when all errors were fixed.The text was updated successfully, but these errors were encountered: