|
|
|
@ -11,7 +11,7 @@ function checkReturn { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Lint |
|
|
|
# Lint |
|
|
|
find $TRAVIS_BUILD_DIR -type f \( -name '*.php' -o -name '*.inc' -o -name '*.module' -o -name '*.install' -o -name '*.test' \) -exec php -l {} \; |
|
|
|
find $TRAVIS_BUILD_DIR -type f \( -name '*.php' -o -name '*.inc' -o -name '*.module' -o -name '*.install' -o -name '*.test' \) -print0 | xargs -0 -n1 php -l |
|
|
|
checkReturn $? |
|
|
|
checkReturn $? |
|
|
|
|
|
|
|
|
|
|
|
# Check line endings |
|
|
|
# Check line endings |
|
|
|
@ -22,16 +22,19 @@ checkReturn $? |
|
|
|
drush coder-review --reviews=production,security,style,i18n,potx $TRAVIS_BUILD_DIR |
|
|
|
drush coder-review --reviews=production,security,style,i18n,potx $TRAVIS_BUILD_DIR |
|
|
|
checkReturn $? |
|
|
|
checkReturn $? |
|
|
|
|
|
|
|
|
|
|
|
# Code sniffer |
|
|
|
# Skip code sniffer for PHP 5.3.3 |
|
|
|
if [ -d "$HOME/.composer/vendor/drupal/coder/coder_sniffer/Drupal" ]; then |
|
|
|
if [ "$(phpenv version-name)" != "5.3.3" ]; then |
|
|
|
DRUPAL_SNIFFS=$HOME/.composer/vendor/drupal/coder/coder_sniffer/Drupal |
|
|
|
# Code sniffer |
|
|
|
elif [ -d "$HOME/.config/composer/vendor/drupal/coder/coder_sniffer/Drupal" ]; then |
|
|
|
if [ -d "$HOME/.composer/vendor/drupal/coder/coder_sniffer/Drupal" ]; then |
|
|
|
DRUPAL_SNIFFS=$HOME/.config/composer/vendor/drupal/coder/coder_sniffer/Drupal |
|
|
|
DRUPAL_SNIFFS=$HOME/.composer/vendor/drupal/coder/coder_sniffer/Drupal |
|
|
|
else |
|
|
|
elif [ -d "$HOME/.config/composer/vendor/drupal/coder/coder_sniffer/Drupal" ]; then |
|
|
|
DRUPAL_SNIFFS="Drupal" |
|
|
|
DRUPAL_SNIFFS=$HOME/.config/composer/vendor/drupal/coder/coder_sniffer/Drupal |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
DRUPAL_SNIFFS="Drupal" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
/usr/bin/phpcs --standard=$DRUPAL_SNIFFS --extensions="php,module,inc,install,test" --ignore="*.md" $TRAVIS_BUILD_DIR |
|
|
|
|
|
|
|
checkReturn $? |
|
|
|
fi |
|
|
|
fi |
|
|
|
/usr/bin/phpcs --standard=$DRUPAL_SNIFFS --extensions="php,module,inc" --ignore="*.md" $TRAVIS_BUILD_DIR |
|
|
|
|
|
|
|
checkReturn $? |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Copy/paste detection |
|
|
|
# Copy/paste detection |
|
|
|
phpcpd --names *.module,*.inc,*.test $TRAVIS_BUILD_DIR |
|
|
|
phpcpd --names *.module,*.inc,*.test $TRAVIS_BUILD_DIR |
|
|
|
|