soderlind / vscode-phpcbf

PHP Code Beautifier and Fixer for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=persoderlind.vscode-phpcbf
GNU General Public License v3.0
28 stars 10 forks source link

Not detecting WordPress runs on a custom ruleset #5

Closed liciniofs closed 6 years ago

liciniofs commented 6 years ago

Hi!

The title says it all... :)

It just formats as PSR2 although I added "phpcbf.standard" : "WordPress-Extra",

Also, "phpcbf.onsave" : true, does nothing...

Thanks!

soderlind commented 6 years ago

If you do, phpcbf -i from the command line, does it list WordPress-Extra ?

liciniofs commented 6 years ago

Yep. :)

which phpcs ~/.composer/vendor/bin/phpcs

which phpcbf ~/.composer/vendor/bin/phpcbf

phpcbf -i The installed coding standards are MySource, PEAR, PHPCS, PSR1, PSR2, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs, WordPress-Extra and WordPress-VIP

Settings: "phpcbf.standard": "WordPress-Extra", "phpcbf.onsave" : true

soderlind commented 6 years ago

.. btw, please update to the lastest version

And, on not triggering onsave. It's an known issue, I'm looking into it ( it fails intermittently :/ )

liciniofs commented 6 years ago

Just updated. :)

Still not recognising WP Standard.

Although I don't think this update was meant to solve this. :)

soderlind commented 6 years ago

The most importaant part in the lastest version was fixing slow/hanging phpcbf.

I'm installing phpcs/cbf into ~/.composer/vendor/bin/ now and will test if I can replicate the problem with using WordPress-Extra.

btw, does any of the other WordPress rules work for you ?

liciniofs commented 6 years ago

No, none.

It's not loading a ruleset.xml either. :)

Thanks!

soderlind commented 6 years ago

phpcs version 3.2.2 ? php version ?

I assume you're on a *nix or macOS box ?

liciniofs commented 6 years ago

phpcs -> 2.9.1

PHP -> 7.0.15

I'm on a Mac with Sierra.

liciniofs commented 6 years ago

Updated to phpcs version 3.2.2

All is good.

Maybe you could add it to the requirements.

Thanks for the help and work!

soderlind commented 6 years ago

No problem, glad to help :)