Tools like PHP_CodeSniffer check your PHP code for compliance with various coding standards. PHP_CodeSniffer can write the results to a XML file.
checkstyle2redmine reads this output file and creates a new issue for every error in Redmine.
c2r
) on your development system.checkstyle2redmine uses the REST API provided by Redmine since version 1.0. Check the Redmine docu on this topic. In short:
Generic call of the script:
checkstyle2redmine.php --file=out.xml --host=URL --API=API_KEY --project=PROJECT_SHORT
Assume the following:
checkstyle.xml
and is in the same directory as the checkstyle2redmine script.testproject
http://redmine.yourhost.com/
ABCD
Then the call would be:
checkstyle2redmine.php --file=checkstyle.xml --host=http://redmine.yourhost.com/ --API=API_KEY --project=ABCD
Note the trailing slash for the host parameter!
In my setup, I created a special user “Style Reporter” for the generated issues with the ‘Reporter’ role. ↩