是否已有方法将Python lint程序(PyLint,PyChecker,PyFlakes等)与 GitHub提交状态API ?通过这种方式,Python lint可以自动调用pull请求来检查代码并提供反馈和代码(以及样式)。 解决方案
您可以使用 Travis-CI 之类的东西,并运行 pylint 作为测试的一部分,沿着以下几行:
language:python install:pip install nose pylint script:nosetests&& pylint当然,提交失败对于轻微的文体违规行为 - 您可能希望禁用某些消息,或者使用 pylint --errors-only 使其更不严格
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).
解决方案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
更多推荐
如何将任何Python lint与GitHub提交状态API集成?
发布评论