How to set CodeIgniter 4 coding standard in a phpcs.xml file ? |
Hello,
I'm working on IonAuth for CI4 : https://github.com/bvrignaud/CodeIgniter...uth/tree/4 I'm trying to set travis jobs. I have problems with the CodeIgniter coding standard implementation (https://github.com/bcit-ci/CodeIgniter4-Standard). If I run on command line : Code: $ vendor/bin/phpcs --standard=vendor/codeigniter4/codeigniter4-standard/CodeIgniter4 . But if I set a phpcs.xml.dist with : Code: <rule ref="vendor/codeigniter4/codeigniter4-standard/CodeIgniter4/" /> Code: $ vendor/bin/phpcs I have this error : PHP Fatal error: Class 'CodeIgniter4\Sniffs\PHP\ForbiddenFunctionsSniff' not found in /home/benoit/MesProjets/Lab/ci4/src/CodeIgniter-Ion-Auth/vendor/codeigniter4/codeigniter4-standard/CodeIgniter4/Sniffs/PHP/DiscouragedFunctionsSniff.php on line 24 Any ideas ? Thanks
I haven't had a chance to look at the standard for about a year since writing it, I see things are moving along with CodeIgniter 4 now so I expect things to start heating up soon, my day jobs been ridiculously busy this past year so I've not chased for updates.
Meanwhile I did do an example travis build way back, so this might be helpful. https://github.com/louisl/CodeIgniter4/b...travis.yml I expect the standard probably needs to change a bit since writing, but I've not had instructions as of yet.
We have added a git commit pre-hook, so if you are using the latest develop branch, you should end up with phpcs automatically applied as part of each commit.
@louisl I think the sniffer rules will need revisiting - they are causing some small degree of havoc and questionable reformatting when used with phpcbf. We are going with the flow for now, and will probably look to do some improvements once we get to the beta.
I think we are all busy, each for different reasons
I found a solution with this phpcs.xml :
Code: <?xml version="1.0" encoding="utf-8" ?>
would be nice if you could make a PR for this
have same problem and the pre-hook doesnt work on windows |
Welcome Guest, Not a member yet? Register Sign In |