Skip to content

Commit

Permalink
sniff PHP 5.6 and clone PHPCS v2.9. Fixes #301 (#302)
Browse files Browse the repository at this point in the history
* sniff PHP 5.6 and clone PHPCS v2.9

* use latest version of node. use npm shorthands.
  • Loading branch information
gregrickaby authored Jun 20, 2017
1 parent c2b719a commit 4292eda
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ matrix:

include:
- php: '5.6'
env: SNIFF=1 # Most production environments are still running PHP 5.6
- php: '7.0'
env: SNIFF=1
- php: '7.1'

allow_failures:
- php: '7.1'

# Use this to prepare the system to install prerequisites or dependencies.
Expand All @@ -36,9 +39,10 @@ before_script:
- export PHPCS_DIR=/tmp/phpcs
- export SNIFFS_DIR=/tmp/sniffs
# Install the latest version of Node (required to run ESLint).
- nvm install stable
- nvm install node
- nvm use node
# Install CodeSniffer for WordPress Coding Standards checks.
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi
- if [[ "$SNIFF" == "1" ]]; then git clone -b 2.9 --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 PHP Compatibility sniffs.
Expand All @@ -50,13 +54,13 @@ before_script:
- if [[ "$SNIFF" == "1" ]]; then phpenv rehash; fi
# Install ESLint: The pluggable linting utility for JavaScript and JSX.
# @link http://eslint.org/
- if [[ "$SNIFF" == "1" ]]; then npm install -g eslint; fi
- if [[ "$SNIFF" == "1" ]]; then npm i -g eslint; fi
# Install WordPress JavaScript Coding Standards shareable config for ESLint.
# @link https://www.npmjs.com/package/eslint-config-wordpress
- if [[ "$SNIFF" == "1" ]]; then npm install -g eslint-config-wordpress; fi
- if [[ "$SNIFF" == "1" ]]; then npm i -g eslint-config-wordpress; fi
# Install Sass Lint.
# @link https://github.com/sasstools/sass-lint
- if [[ "$SNIFF" == "1" ]]; then npm install -g sass-lint; fi
- if [[ "$SNIFF" == "1" ]]; then npm i -g sass-lint; fi

# Run test script commands.
# Default is specific to project language.
Expand All @@ -75,7 +79,7 @@ script:
# --extensions: Only sniff PHP files.
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs -p -s -v -n . --standard=./phpcs.xml --extensions=php; fi
# Run the theme JavaScript partials through ESLint.
- if [[ "$SNIFF" == "1" ]]; then eslint -c ./.eslintrc.js ./assets/scripts/concat; fi
- if [[ "$SNIFF" == "1" ]]; then eslint -v -c ./.eslintrc.js ./assets/scripts/concat; fi
# Run the theme Sass partials through Sass Lint.
- if [[ "$SNIFF" == "1" ]]; then sass-lint -v -q -c ./.sass-lint.yml ./assets/sass/**/*.scss; fi

Expand Down

0 comments on commit 4292eda

Please sign in to comment.