Open garrettw opened 6 years ago
I am seeing the same error. Mac OS X 10.13.6 (17G65) PHPCS 3.3.1 Code 1.27.1 (1.27.1)
It seems that:
phpcs.executablePath
and
Phpcs: Executable Path
Optional. The path to the phpcs executable.
are not optional.
Current fix as stated by OP:
"phpcs.executablePath": "/Users/${YOUR_USERNAME}/.composer/vendor/squizlabs/php_codesniffer/bin/phpcs"
Composer copies all "bin" files into one central location, so /Users/${YOUR_USERNAME}/.composer/vendor/bin
is sufficient.
Also, I have phpcs working on a different machine without setting phpcs.executablePath
-- so it is indeed optional if everything else involved works correctly.
I'm on macOS. I installed phpcs globally with composer, and then added it to my global path by appending
~/.composer/vendor/bin
to/etc/paths
. After verifying in a new terminal that typingphpcs
did in fact work, I restarted VS Code only to find that it still couldn't locate the executable. Interestingly enough, runningwhich phpcs
at this point gave me no output.So I changed the line in
/etc/paths
to be/Users/username/.composer/vendor/bin
, and VS Code no longer gave me that error. Also,which phpcs
now gives me the expected output.Is it possible for this extension to be made to work with a global path containing
~
?