i followed below steps in windows local system
first installed xammp
- cd C:\xampp\php
pear install PHP_CodeSniffer
pear install --alldeps PHP_CodeSniffer
(if there is any issue run cmd as Administrator)
phpcs -i
then to follow Magento coding install magento-ecg/coding-standard from composer
after install it will be in C:\xampp\htdocs\magento217\vendor\magento-ecg\
now run (C:\xampp\php>)
phpcs --config-set installed_paths C:\xampp\htdocs\magento217\vendor\magento-ecg\coding-standard
now it will have all plugins need for M2
phpcs -i
The installed coding standards are PSR1, PSR2, PEAR, MySource, PHPCS, Zend, Squiz, Ecg and EcgM2
To test Module run below code
C:\xampp\php>phpcs C:\xampp\htdocs\magento217\app\code\NAMESPACE\MODULE_NAME
/usr/share/php/PHP/CodeSniffer/Standards/
Another thing you can try is using full path to standards directory:phpcs --config-set installed_paths /home/your_user/vendor/magento-ecg/coding-standard