woocommerce/tests/bin/phpcs.sh

12 lines
471 B
Bash
Raw Normal View History

2017-10-09 20:31:15 +00:00
#!/usr/bin/env bash
if [[ ${RUN_PHPCS} == 1 ]]; then
2017-10-09 20:31:15 +00:00
CHANGED_FILES=`git diff --name-only --diff-filter=ACMR $TRAVIS_COMMIT_RANGE | grep \\\\.php | awk '{print}' ORS=' '`
IGNORE="tests/cli/,apigen/,includes/gateways/simplify-commerce/includes/,includes/libraries/,includes/api/legacy/"
2017-10-10 01:16:25 +00:00
if [ "$CHANGED_FILES" != "" ]; then
2017-10-09 20:31:15 +00:00
echo "Running Code Sniffer."
./vendor/bin/phpcs --ignore=$IGNORE --standard=./phpcs.ruleset.xml --encoding=utf-8 -n -p $CHANGED_FILES
fi
2017-10-10 12:34:47 +00:00
fi