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 "composer fix" to run php-cs-fixer and phpcbf. #3426
Add "composer fix" to run php-cs-fixer and phpcbf. #3426
Conversation
Includes a change to phpcbf to run it with the output of phpcs, because phpcs is much faster with the cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @EreMaijala, this is great! Just one small comment. (I also committed a fix to adjust some minor indentation inconsistencies).
build.xml
Outdated
</filterchain> | ||
</property> | ||
<!-- Finally, run phpcbf: --> | ||
<exec command="${srcdir}/vendor/bin/phpcbf --standard=${srcdir}/tests/phpcs.xml ${phpcbf_filelist}" escape="false" passthru="true" checkreturn="true" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we might want to change checkreturn to "false" here -- otherwise, when phpcbf fixes something, the process behaves as though something has gone wrong due to the return status. Any objection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No objection. It just was that way before and I didn't touch it or give it a thought at all. Changed in the last commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to give an approval here. I don't know much about php-cs-fixer and phpcbf but in reading about them they look good. Speed increases are always welcome and I don't see any problems here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well for me now; thanks, @EreMaijala!
(I'm not entirely sure why a non-zero return code became a problem now when it was not an issue in the past, but maybe the added arguments to phpcbf change the way its return values operate).
Includes a change to phpcbf to run it with the output of phpcs, because phpcs is much faster with the cache.