diff --git a/.travis.yml b/.travis.yml index ea49372c1..d52fa002f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,17 +13,17 @@ matrix: # aliased to a recent 5.6.x version - php: '5.6' env: - #- SNIFF=1 - WP_VERSION=latest - WP_MULTISITE=0 - php: '5.6' env: - #- SNIFF=1 - WP_VERSION=latest - WP_MULTISITE=1 # aliased to a recent 7.x version - php: '7.0' - env: WP_VERSION=latest + env: + - SNIFF=1 + - WP_VERSION=latest # aliased to a recent hhvm version - php: 'hhvm' env: WP_VERSION=latest @@ -39,11 +39,13 @@ before_script: - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi # Install WordPress Coding Standards. - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $SNIFFS_DIR; fi + # Install VIP Coding Standards. + - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/automattic/VIP-Coding-Standards.git $SNIFFS_DIR/VIP-Coding-Standards; fi # Install PHP Compatibility sniffs. - if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $SNIFFS_DIR/PHPCompatibility; fi # Set install path for PHPCS sniffs. # @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941 - - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs --config-set installed_paths $SNIFFS_DIR; fi + - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs --config-set installed_paths $SNIFFS_DIR,$SNIFFS_DIR/VIP-Coding-Standards; fi # After CodeSniffer install you should refresh your path. - if [[ "$SNIFF" == "1" ]]; then phpenv rehash; fi # Set up unit tests @@ -63,7 +65,7 @@ script: # -n flag: Do not print warnings. (shortcut for --warning-severity=0) # --standard: Use WordPress as the standard. # --extensions: Only sniff PHP files. - - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs -p -s -v -n . --standard="WordPress-VIP" --extensions=php; fi + - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs -p -s -v -n . --standard="WordPress-VIP-Go" --ignore=assets/*,vendor/*,bin/*,node_modules/*; fi # Run unit tests - phpunit # Run linting