Created
June 29, 2016 13:05
-
-
Save skwashd/66f10081deedb4de43f721569b710a31 to your computer and use it in GitHub Desktop.
Incrementally improve your Drupal code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: php | |
sudo: false | |
php: | |
- 5.6 | |
install: | |
# Remove xdebug to make composer faster. | |
- phpenv config-rm xdebug.ini | |
# add composer's global bin directory to the path | |
- export PATH="$HOME/.composer/vendor/bin:$PATH" | |
# Install PHP_CodeSniffer and Drupal config | |
- composer global require drupal/coder | |
- phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer | |
before_script: | |
# This slows things down but it ensures all remote branches are fetched. | |
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" | |
- git fetch --unshallow | |
- git fetch origin | |
script: | |
# Check code sniffer compliance. | |
- git diff --name-only origin/master | xargs phpcs --standard=Drupal | |
# Optional slack notifications. | |
notifications: | |
slack: | |
rooms: | |
- subdomain:token#channel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git diff --name-only origin/master
includes paths to files that have been deletedgit diff --name-only origin/master --diff-filter=ACMRTUXB | xargs phpcs --standard=Drupal
will filter deleted files.