Skip to content

Commit

Permalink
Merge pull request #541 from Automattic/fix/phpcs-travis
Browse files Browse the repository at this point in the history
Reinstate PHPCS and update VIP sniffs
  • Loading branch information
philipjohn authored Oct 16, 2018
2 parents efc8a5d + 8de33ec commit ddfb1c6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ddfb1c6

Please sign in to comment.