language: php matrix: include: # Arbitrary PHP version to run the sniffs against. - php: '7.1' before_install: - export PHPCS_DIR=/tmp/phpcs - export SNIFFS_DIR=/tmp/sniffs # Install PHP_CodeSniffer. - git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR # Install WordPress Coding Standards. - git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $SNIFFS_DIR # Set install path for WordPress Coding Standards. - $PHPCS_DIR/bin/phpcs --config-set installed_paths $SNIFFS_DIR # After CodeSniffer install you should refresh your path. - phpenv rehash script: # Run against WordPress Coding Standards. # If you use a custom ruleset, change `--standard=WordPress` to point to your ruleset file, # for example: `--standard=wpcs.xml`. # You can use any of the normal PHPCS command line arguments in the command: # https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage - $PHPCS_DIR/bin/phpcs -p . --standard=WordPress --extensions=php --runtime-set ignore_warnings_on_exit 1