Tuesday, October 11, 2016

Setting up Python Warnings on Jenkins

Using pylint is a great way to help code quality. And the best way to use pylint is to integrate it with your continuous integration server.

Jenkins is the CI server I use, and it has a pylint plug-in  that I needed to install.

For that I go to "Manage Jenkins" on the menu, and select "Manage Plug-ins". Before I can do anything, Jenkins asks me to install updates for a bunch of plugins I already have installed, and I do that, because why not?

I installed the cobertura plug-in, because I will need it later for code coverage reports. But the plugin I need for warnings is called the violations plugin.

There is a good blog post describing this procedure.

The only tricky part was that my coverage.xml was being generated in the tests directory. It's necessary to put the path of this file into Jenkins configuration.

However, now that it is working, I have nice charts of warnings and code coverage on my Jenkins page!



My code coverage is about 40%. Not good!



I have 18 pylint warnings, which is a lot for the tiny amount of code that I checked in.


No comments:

Post a Comment