Enforce coding standards in CI
With the promise of a restored CI pipeline, now seems a good time to introduce code style checks for MRs and tidy up a little bit of inconsistent formatting from previous contributions.
A bit of back and forth here while I found an approach that (1) didn't break tests running on PHP5.6 and (2) delivered decent coverage:
- !94 (closed) has CI checks using phpcs only to ensure PSR12 formatting for all PHP files
- !95 (merged) (my preference) has CI checks using GrumPHP which includes the above, composer validation, and opportunity to extend to additional checks for other types.
The MR also tidies up existing code which did not meet PSR12 (most of the codebase did, only a few spots where community MRs had deviated I think).
CI changes could ensure that code is linted according to the rules in grumphp.yml before we run the full test suite; this can optionally save us running the full test suite where code doesn't meet formatting standards. (To activate that we'd remove needs: []
from .test_template
.)
Edited by Chris Burgess