Hi Friends, I want to integrate Pylint into my jenkins job such that the job should fail when the Pylint score is below say 8. I found many plugins which displays Pylint metrics but I could not found any plugin which returns true / false or some value based on my pylint score. Any idea how can this be done? Thanks, Prashant
Hi Prashant, This does not directly answer your question - so apologies for that. However, pylint gives an exit code based on the types of failures that were found which can be checked https://pylint.readthedocs.io/en/latest/user_guide/run.html#exit-codes Therefore when linting flake8-aaa, I gave up trying to check for a threshold score in order to allow for success and instead there is a script that checks that there are no errors of particular types (FATAL_MESSAGE, ERROR_MESSAGE, CONVENTION_MESSAGE, USAGE_ERROR). That script is here https://github.com/jamescooke/flake8-aaa/blob/master/run_pylint.sh and it's called via a Makefile recipe here https://github.com/jamescooke/flake8-aaa/blob/master/Makefile#L24-L38 When working on this, I found that there were some helpful messages on SO, a quick search has taken me back to this old one: https://stackoverflow.com/a/7347681/1286705 Hope that helps. James On Tue, 16 Oct 2018, at 11:27 AM, Prashant Sabnekar wrote:
Hi Friends,
I want to integrate Pylint into my jenkins job such that the job should fail when the Pylint score is below say 8.> I found many plugins which displays Pylint metrics but I could not found any plugin which returns true / false or some value based on my pylint score.> Any idea how can this be done?
Thanks, Prashant _________________________________________________ code-quality mailing list code-quality@python.org https://mail.python.org/mailman/listinfo/code-quality
The Open edX project has a Jenkins job that does something similar by using a custom Python script which runs pylint, parses the generated report, and compares the number of reported issues against specified upper and lower limits: https://github.com/edx/edx-platform/blob/master/pavelib/quality.py#L166. This is particularly useful when you start applying stricter rules to a legacy codebase, and want to avoid new violations of them without immediately needing to do a huge cleanup effort. You just need to keep lowering the upper limit as the legacy violations gradually get fixed. Jeremy On 2018-10-16 06:27, Prashant Sabnekar wrote:
Hi Friends,
I want to integrate Pylint into my jenkins job such that the job should fail when the Pylint score is below say 8.
I found many plugins which displays Pylint metrics but I could not found any plugin which returns true / false or some value based on my pylint score.
Any idea how can this be done?
Thanks, Prashant _______________________________________________ code-quality mailing list code-quality@python.org https://mail.python.org/mailman/listinfo/code-quality
participants (3)
-
James Cooke
-
Jeremy Bowman
-
Prashant Sabnekar