Browse Source

Fix lint and only do sniffs if not PHP 5.3.3

pull/714/head
Jared Whiklo 7 years ago
parent
commit
5f187cfdd5
  1. 7
      tests/scripts/travis_scripts.sh

7
tests/scripts/travis_scripts.sh

@ -11,7 +11,7 @@ function checkReturn {
}
# 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 $?
# Check line endings
@ -22,6 +22,8 @@ checkReturn $?
drush coder-review --reviews=production,security,style,i18n,potx $TRAVIS_BUILD_DIR
checkReturn $?
# Skip code sniffer for PHP 5.3.3
if [ "$(phpenv version-name)" != "5.3.3" ]; then
# Code sniffer
if [ -d "$HOME/.composer/vendor/drupal/coder/coder_sniffer/Drupal" ]; then
DRUPAL_SNIFFS=$HOME/.composer/vendor/drupal/coder/coder_sniffer/Drupal
@ -30,8 +32,9 @@ elif [ -d "$HOME/.config/composer/vendor/drupal/coder/coder_sniffer/Drupal" ]; t
else
DRUPAL_SNIFFS="Drupal"
fi
/usr/bin/phpcs --standard=$DRUPAL_SNIFFS --extensions="php,module,inc" --ignore="*.md" $TRAVIS_BUILD_DIR
/usr/bin/phpcs --standard=$DRUPAL_SNIFFS --extensions="php,module,inc,install,test" --ignore="*.md" $TRAVIS_BUILD_DIR
checkReturn $?
fi
# Copy/paste detection
phpcpd --names *.module,*.inc,*.test $TRAVIS_BUILD_DIR

Loading…
Cancel
Save