Skip to content

Using PHPCheckstyle with Travis CI

tchule edited this page Oct 20, 2017 · 1 revision

The script "run.php" return an exit code of 1 if there is at least an error in the checked files. If there is only warnings and infos, the exit code is 0.

To use TravisCI you can simply add a script shell in the build that launches PHPCheckstyle.

#!/bin/sh
echo "PHP CheckStyle script"
php run.php --src ./src --outdir ./checkstyle_result --config default.cfg.xml --format html,xml --linecount`

This project itself is using Travis : https://travis-ci.org/PHPCheckstyle/phpcheckstyle

Travis config for this project : https://github.com/PHPCheckstyle/phpcheckstyle/blob/master/.travis.yml