PHPCS with Drupal Standards on Debian

By Bill Seremetis, 10 April, 2021

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