ikappas / vscode-phpcs

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

php file lint errors not marked when using standards defined in phpcs.xml.dist #168

Open danfoley opened 4 years ago

danfoley commented 4 years ago

phpcs plugin works fine on almost all the file in my project. I have standards set to PSR-2. I have Auto Config Search set to true

When I am in a directory of a PHP package that I am working on, which has its coding standards set to Doctrine via its phpcs.xml.dist file, phpcs will not mark lint errors. It runs phpcs with no error notifications displayed in Vscode, as I have installed Doctrine coding standards globally with composer. But it does not mark any lint errors in the file.

I have run phpcs manually on the same file like this: phpcs --standard="Doctrine" -q --report=json --encoding=UTF-8 myFilepath/myfile.php > test.json The contents of test.json are valid json containing the lint errors.

If I disable Auto Config Search PSR-2 lint errors will show up in my document.

Can I get some help figuring out why, when it uses the Doctrine standards as defined by the package, it doesn't work?