ikappas / vscode-phpcs

PHP CodeSniffer for Visual Studio Code
MIT License
128 stars 56 forks source link

use files.associations php files instead of "php" document #187

Open vijayakumarkarthik opened 3 years ago

vijayakumarkarthik commented 3 years ago

Currently when the file extension is .module, .inc etc, phpcs extension is not working.

leolandotan commented 2 years ago

I'm having the same issue. Did you find fix @vijayakumarkarthik ?

jefflogan303 commented 2 years ago

I couldn't find a workaround with this extension so used an alternative extension PHP Sniffer which does use the php files.associations settings: https://marketplace.visualstudio.com/items?itemName=wongjn.php-sniffer

The github project is here: https://github.com/wongjn/vscode-php-sniffer

wakkoism commented 2 years ago

You have to have your phpcs.xml define or something similar in the project root. This is the one I use from Drupal https://github.com/drupal/core/blob/8.9.x/phpcs.xml.dist

jefflogan303 commented 2 years ago

Thank you for explaining this, i'll give this extension another try.