commit
4f3918c725
20
.travis.yml
20
.travis.yml
|
@ -29,6 +29,12 @@ env:
|
|||
# e.g. copy database configurations, environment variables, etc.
|
||||
# Failures in this section will result in build status 'errored'.
|
||||
before_script:
|
||||
# Speed up build time by disabling Xdebug.
|
||||
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
|
||||
# Set up temporary paths.
|
||||
- export PHPCS_DIR=/tmp/phpcs
|
||||
- export WPCS_DIR=/tmp/wpcs
|
||||
- export PHPCOMPAT_DIR=/tmp/phpcompatibility
|
||||
# Set up WordPress installation.
|
||||
- export WP_DEVELOP_DIR=/tmp/wordpress/
|
||||
- mkdir -p $WP_DEVELOP_DIR
|
||||
|
@ -49,14 +55,14 @@ before_script:
|
|||
# Create WordPress database.
|
||||
#- mysql -u root -e "CREATE DATABASE wordpress_test;"
|
||||
# Install CodeSniffer for WordPress Coding Standards checks.
|
||||
- mkdir php-codesniffer && curl -L https://github.com/squizlabs/PHP_CodeSniffer/archive/3.5.0.tar.gz | tar xz --strip-components=1 -C php-codesniffer
|
||||
- git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR
|
||||
# Install WordPress Coding Standards.
|
||||
- mkdir wordpress-coding-standards && curl -L https://github.com/WordPress/WordPress-Coding-Standards/archive/2.1.1.tar.gz | tar xz --strip-components=1 -C wordpress-coding-standards
|
||||
# Hop into CodeSniffer directory.
|
||||
- cd php-codesniffer
|
||||
# Set install path for WordPress Coding Standards
|
||||
- git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR
|
||||
# Install PHP Compatibility sniffs.
|
||||
- git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $PHPCOMPAT_DIR
|
||||
# Set install path for PHPCS sniffs.
|
||||
# @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941
|
||||
- bin/phpcs --config-set installed_paths ../wordpress-coding-standards
|
||||
- $PHPCS_DIR/bin/phpcs --config-set installed_paths $WPCS_DIR,$PHPCOMPAT_DIR
|
||||
# Hop into themes directory.
|
||||
- cd $theme_dir
|
||||
# After CodeSniffer install you should refresh your path.
|
||||
|
@ -88,4 +94,4 @@ script:
|
|||
# -n flag: Do not print warnings (shortcut for --warning-severity=0)
|
||||
# --standard: Use WordPress as the standard.
|
||||
# --extensions: Only sniff PHP files.
|
||||
- $WP_DEVELOP_DIR/php-codesniffer/scripts/phpcs -p -s -v -n . --standard=./codesniffer.ruleset.xml --extensions=php --ignore=*/woocommerce/*,*/src/*
|
||||
- $PHPCS_DIR/bin/phpcs -p -s -v -n . --extensions=php --ignore=*/woocommerce/*,*/src/*
|
||||
|
|
Reference in New Issue