Description
Right now we have the codechecker
command that reports all the issues found by phpcs
. This is useful locally and @ CIs.
Also, there is the codecbf
command that also runs phpcs
but in fix mode, changing as much as possible. Always exiting without error (exit code = 0). This is useful locally, but not much @ CIs.
So this is a proposal to create a new codefixer
command, pretty much like the codecbf
one (in fact it could end replacing it, more below) with the following features:
- Run the
phpcs
fixer. - If there are changes performed exit with error.
So the proposal is as follows:
- Create new
codefixer
command. - Make it exit with error if fixes have been applied.
- Allow it to always exit without error (via switch), so we can, one of:
A) remove currentcodecbf
command completely. Or
B) keep it, but making it to call to the new command with appropriate switch.
That way, for people wanting to add it, it will ensure that as much as possible of phpcs
detected problems have been fixed (interesting for CI) and, still, for people just wanting to run it (as part of local dev process or other automations) ignoring the exit status, there will be a switch available.
Ciao :-)
Edited: Surely will have to be done together with #74