如何将任何Python lint与GitHub提交状态API集成?

编程入门 行业动态 更新时间:2024-10-28 13:17:59
本文介绍了如何将任何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集成?

本文发布于:2023-11-24 08:20:49,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   状态   Python   lint   GitHub

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!