themeum / kirki

Extending the customizer
https://kirki.org
MIT License
1.26k stars 329 forks source link

phpcs no longer executes #2062

Closed aristath closed 5 years ago

aristath commented 5 years ago

This has baffled me for quite some time now. PHPCS no longer runs. Both on local (ubuntu) and on travis it doesn't seem to actually be running. I've tried everything I can think of and though it's probably something simple I just can't find it. @jrfnl any ideas on what might be going on here? I'm asking since you did a lot of the work in the cs files and all related areas here

To test:

It doesn't throw any errors, but even this doesn't do anything vendor/bin/phpcs --help and that is certainly weird. :thinking:

jrfnl commented 5 years ago

@aristath I've had a quick look and found the following:

  1. Your composer.lock file is out of sync.
  2. You need to update your dependencies: composer update --with-dependencies phpcompatibility/phpcompatibility-wp wp-coding-standards/wpcs dealerdirect/phpcodesniffer-composer-installer
  3. And this is the real cause (and don't ask me why, I didn't dig any deeper): your autoload directive in your composer.json file is blocking PHPCS from loading. If you remove that autoload directive, everything starts working again. So, I suggest you read up on configuring that better: https://getcomposer.org/doc/04-schema.md#autoload
aristath commented 5 years ago

thank you for taking a look, I appreciate it!

jrfnl commented 5 years ago

Oh and I just realize that you can ignore the first two points as the composer.lock file is not committed, but I still had an old one hanging around in my local clone ;-)

aristath commented 5 years ago

Brilliant, it was the autoload. Thanks!