-
-
Save Melonangie/d87b50a811b4c5775f304e58d7c2e311 to your computer and use it in GitHub Desktop.
Install and configure PHPCS for Drupal https://www.drupal.org/node/1587138
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install drupal/coder | |
| composer global require squizlabs/php_codesniffer ^3.0 | |
| composer global require drupal/coder ^8.3 | |
| composer global require dealerdirect/phpcodesniffer-composer-installer | |
| # Register Drupal and DrupalPractice Standard with PHPCS | |
| phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer | |
| phpcs -i | |
| # Colorise output | |
| phpcs --config-set colors 1 | |
| # Add aliases | |
| alias drupalcs="phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md,yml --ignore=node_modules,bower_components,vendor" | |
| alias drupalbp="phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md,yml --ignore=node_modules,bower_components,vendor" | |
| alias drupalcbf="phpcbf --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md,yml --ignore=node_modules,bower_components,vendor" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment