Search code examples
phpjenkinsphpdoc

phpdoc / phpcodesniffer checkstyle file


I'm using Jenkins to build my php projects. I use some config found in the internet which is based on phpcodesniffer to display code styling violations. I'm very happy with the results.

Some time ago I was using also phpdoc which was informing me about missing comments doc blocks in files.

Now I wanted to use it's feature to prepare better docs. Unfortunately the information of missing docblocks is saved to file checkstyle.xml - the same used by codesniffer.

The question is - how can I change codesniffer PSR-2 configuration to allow informing me about missing blocks or alternatively - how can I combine in Jenkins output of those two processes.

Maybe there is any other way to accomplish that?


Solution

  • I think the Jenkins plugin that processes that checkstyle file will allow you to put in a wildcard pattern, rather than insisting on just a literal filename. So, if phpdoc produces checkstyle-phpdoc.xml, and phpcs produces checkstyle-phpcs.xml, then set the Jenkins plugin to look for checkstyle-*.xml. I'm expecting that it will merge all matching files and process it as one batch.