moodle-plugin-ci
                                
                                
                                
                                    moodle-plugin-ci copied to clipboard
                            
                            
                            
                        RFC: Create new "codefixer" Command
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 
phpcsfixer. - If there are changes performed exit with error.
 
So the proposal is as follows:
- Create new 
codefixercommand. - 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 current 
codecbfcommand 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
Just noting that, since recently we have:
phpcscommand, withcodecheckeras alias.phpcbfcommand, withcodefixeras alias.
And, at some point, the aliases will be deprecated / removed.
Not closing this, because the idea of having the phpcbf (codefixer) command having configurable exit code is still valid. Just sharing the "reserved words" (command names and aliases) that we have right now.
Ciao :-)