Is there already a way to integrate one of Python lint programs (PyLint, PyChecker, PyFlakes, etc.) with GitHub commit status API? In this way Python lint could be automatically called on pull requests to check the code and provide feedback and code (and style).
-
possible duplicate of Enforcing PEP-8'ish formatting in Github commitsMartijn Pieters– Martijn Pieters2012-09-16 20:14:11 +00:00Commented Sep 16, 2012 at 20:14
-
Presumably, that's exactly the sort of thing it's for. Is that your question?Hamish– Hamish2012-09-16 20:14:20 +00:00Commented Sep 16, 2012 at 20:14
-
3@MartijnPieters this is nothing to do with commit hooks.Hamish– Hamish2012-09-16 20:14:43 +00:00Commented Sep 16, 2012 at 20:14
-
So I understand that Python lint programs can in theory be integrated with GitHub commit status API. My questions is if there is already something like this available somewhere? Or as an existing cloud services or as an installation I can put on my server and it is called from GitHub.Mitar– Mitar2012-09-16 22:30:50 +00:00Commented Sep 16, 2012 at 22:30
2 Answers
You could use something like Travis-CI, and run pylint as part of your tests, along the lines of:
language: python
install: "pip install nose pylint"
script: "nosetests && pylint"
Of course that fails commits for minor stylistic violations - you'd probably want to disable certain messages, or use pylint --errors-only to make it less stringent
4 Comments
I had the same question, and just found this blog post describing a project called pylint-server for doing something similar (though triggered on Travis CI build events, not pulls).
From the README:
A small Flask app to keep keep track of pylint reports and ratings on a per-repository basis.
I haven't tried it yet, so I can't comment on its quality. If anyone tries it, please comment and let us know how you like it.