Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinstate PHPCS and update VIP sniffs #541

Merged
merged 8 commits into from
Oct 16, 2018
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