如何将任何Python lint与GitHub提交状态API集成? [英] How to integrate any Python lint with GitHub commit status API?

查看:153
本文介绍了如何将任何Python lint与GitHub提交状态API集成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否已有方法将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集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆