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

后端 未结 2 1939
说谎
说谎 2020-12-31 03:36

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 automatic

相关标签:
2条回答
  • 2020-12-31 03:50

    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

    0 讨论(0)
  • 2020-12-31 03:55

    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.

    0 讨论(0)
提交回复
热议问题