I want to check My Extension's coding standard for Magento Marketplace before submitting it on **Magento Marketplace*. Can anyone tell me how can I install coding standard in My Local Environment
and check my extension whether this extension is eligible or not for Magento Marketplace code standard.
Thanks In Advance..!
Best Answer
Magento use
EQP Coding Standard
tool for checking the coding standard of a module.https://github.com/magento/marketplace-eqpMagento this tool used basically using PHP_CodeSniffer tool.
If you want to in run
EQP Coding Standard
on your local system, then follow steps:composer create-project --repository=https://repo.magento.com magento/marketplace-eqp magento-coding-standard
Then go to this tool directly using
cd magento-coding-standard
run Composer update command
composer install
which will update module dependency packages. Also set config path specific PHP version set paths to php binary dirvendor/bin/phpcs --config-set php7.0_path /path/to/your/php7
After that, you can use below command for checkout code start of your module from magento-coding-standard folder
php vendor/bin/phpcs /path/to/your/extension --standard=MEQP2
use MEQP2 for magento2 extension.
Example:
Here i give full path of my extension
/var/www/html/MagentoProkect/app/code/DevAmitbera/CustomModule
4.1. If you use windows and face some
path must be translated
related warning in command line then try below solution. InstallCygwin
console from https://cygwin.com and then go tomagento-coding-standard
directory and run below command.Example:
After re-run Step 4 command for check out the rest of error which you need to fix yourself manually.