PHPCS with Drupal Standards on Debian

Posted by Bill Seremetis on 2021, April 10 - 13:13

While this article is the de facto choice for everybody working with Drupal, you might run into some problems if you follow it blindly. Most important, composer global is under .config/composer.

Installation is actually pretty straightforward:

# Install from apt:
apt install php-codesniffer
# or from composer:
composer global require squizlabs/php_codesniffer
composer global require drupal/coder
phpcs --config-set installed_paths ~/.config/composer/vendor/drupal/coder/coder_sniffer
phpcs -i