squizlabs / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
10.66k stars 1.48k forks source link

Warning: spawn ENAMETOOLONG aborted due to warnings #2012

Closed UVLabs closed 6 years ago

UVLabs commented 6 years ago

image

I'm on Windows 10 64bit

I'm working a bit on this repository(please clone to be able to follow along, it's a WordPress plugin):

https://github.com/Codeinwp/tweet-old-post

https://code.tutsplus.com/tutorials/using-php-codesniffer-with-wordpress-installing-and-using-the-wordpress-rules--cms-26443

It downloaded inside the cloned repo directory(I'm thinking this might be the cause, but I tried downloading it outside of the cloned repo and was getting an error when I tried to run grunt local):

image

image

When i run grunt local I get the error spawn ENAMETOOLONG...I'm new to dependency management and all these things so I'm a bit lost, I spend hours googling but didn't find anything that could help, would greatly appreciate if I can get some help on this...it's preventing me from being able to contribute to that repository

UVLabs commented 6 years ago

The solution was like I suspected, adding wpcs to the repo directory caused an issue.

After adding the wpcs to a separate folder and instead of running:

phpcs --config-set installed_paths wpcs

I instead ran:

phpcs --config-set installed_paths <full path to wpcs folder>

It now works fine

jrfnl commented 6 years ago

@UVLabs You may want to consider adding Dealerdirect/phpcodesniffer-composer-installer: ^0.4.3 to your Composer dependencies. It will sort the installed paths out automatically, no matter how many external standards you may add.