Open designvoid opened 9 years ago
Seconding this issue - we have solved it by simply copying by copying a special CodeSniffer.conf to the build folder's squizlabs vendor directy using the shell plugin in the setup part of the phpci.yml.
I've just hit this and got thoroughly confused since my server already had phpcs correctly configured. I've temporarily solved it by running vendor/squizlabs/php_codesniffer/scripts/phpcs --config-set installed_paths /usr/local/share/wpcs/ but seems there should be a nicer solution.
Asuming there are the following 3 scenarios when specifying Standards in the config file for PHPCS:
1) Using 1 of defaults (ie PSR2 etc) 2) Using a standard included within the Project 3) Using a standard located outside of the project (elsewhere on server)
The exisitng code on line 187 of PHPCI/Plugin/PhpCodeSniffer.php
Doesn't handle these 3 scenarios, it adds the project directory to the standard irrespecitive of wether it starts with a leading '/' or not. If you are providing an absolute path there is no need for the leading '/'
I have modified my copy of the file thusly:
Now it works as expected (to me at least) so I welcome a response from the team as to wether this is correct or not?