geerlingguy / jeffgeerling-com

Drupal Codebase for JeffGeerling.com
https://www.jeffgeerling.com
GNU General Public License v2.0
40 stars 2 forks source link

Add PHP Code Sniffer to project for CI testing #49

Closed geerlingguy closed 4 years ago

geerlingguy commented 4 years ago

I want to have a PHP standards check in the CI workflow on GitHub (and available locally) to ensure my site's codebase conforms to Drupal's coding standards. See: https://www.drupal.org/docs/8/modules/code-review-module/installing-coder-sniffer

It seems that the best way to do this is:

  1. Install Coder: composer require --dev drupal/coder dealerdirect/phpcodesniffer-composer-installer
  2. Test that it's working: ./vendor/bin/phpcs -i