drupal_ti icon indicating copy to clipboard operation
drupal_ti copied to clipboard

Provide support for running phpcs

Open davereid opened this issue 9 years ago • 4 comments

Having an example of how to use https://github.com/squizlabs/PHP_CodeSniffer or https://github.com/FriendsOfPHP/PHP-CS-Fixer would be nice for module:

Here's what we had in our .travis.yml file for a d8 module before switching to drupal_ti:

env:
  global:
    PHPCS_VERSION='2.0.*@dev'
    CODER_VERSION='8.2.0-alpha2'
before_install:
  composer global require squizlabs/php_codesniffer:$PHPCS_VERSION
  composer global require drupal/coder:$CODER_VERSION
  ln -s ~/.composer/vendor/drupal/coder/coder_sniffer/Drupal ~/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/
script:
  phpcs --report=full --standard=Drupal $TRAVIS_BUILD_DIR/drupal/modules/$MODULE_NAME

davereid avatar Jul 08 '15 20:07 davereid

That sounds like a great idea to me!

LionsAd avatar Jul 09 '15 17:07 LionsAd

This will be a test suite 'runner', called phpcs-drupal.

LionsAd avatar Jul 24 '15 19:07 LionsAd

I was curious if this has been completed yet

nerdstein avatar Aug 15 '15 03:08 nerdstein

you can install DCR (https://github.com/alexdesignworks/dcr) via composer that will handle all required phpcs dependencies, including Drupal and DrupalSecure

AlexSkrypnyk avatar Dec 02 '15 11:12 AlexSkrypnyk