Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating PEP8 xml report for Jenkins/Violations use

I've setup Cobertura successfully to run through Jenkins and generate coverage reports, now I'm stuck on configuring Violations to report results for pep8 tests.

Right now I have it so that I run PEP8 with a batch command and it generate a .txt file that stores all the violations which ends up in the workspace.

Do I have to define batch commands to create an xml file for these violations to send to the Report Violations Post-build action? If so, how would I define that command?

like image 878
Tyler Plude Avatar asked May 31 '13 13:05

Tyler Plude


1 Answers

As Vajk points out, you do not need an XML file. You can simply pipe the output of the pep8 utility to a file and use that as the violations file in Jenkins.

For example in your Jenkins build configuration under:

Build -> Execute Shell -> Command

you can write:

pep8 path/to/code > pep8_report.txt

And then under:

Post-build Actions -> Report Violations -> pep8 / XML filename pattern

add:

pep8_report.txt

Note that even though the UI asks for an XML file and the file is not an XML file, this worked fine for me on Jenkins version 1.499.

like image 117
Rachel K. Westmacott Avatar answered Oct 31 '22 08:10

Rachel K. Westmacott