LionsAd / drupal_ti

Drupal - Travis Integration
82 stars 37 forks source link

Provide support for running phpcs #12

Open davereid opened 9 years ago

davereid commented 9 years ago

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
LionsAd commented 9 years ago

That sounds like a great idea to me!

LionsAd commented 9 years ago

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

nerdstein commented 9 years ago

I was curious if this has been completed yet

AlexSkrypnyk commented 8 years ago

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