Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate any Python lint with GitHub commit status API?

Tags:

python

github

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).

like image 676
Mitar Avatar asked Sep 16 '12 20:09

Mitar


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

like image 86
dbr Avatar answered Oct 01 '22 14:10

dbr


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.

like image 23
Stew Avatar answered Oct 01 '22 12:10

Stew