Pylint白名单模型

2024-06-14 11:12:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我的团队正在考虑将pylint整合到我们的开发过程中。根据我的经验,短绒适合于非常基本的检查,但最终会产生大量的误报,而且可能比帮助更烦人。因此,我希望在白名单模式下运行pylint,默认情况下所有警告都被禁用,随着时间的推移,我们会逐渐添加我们感兴趣的警告。我在谷歌上搜索了一下,发现没有明显的方法。有没有办法不通过.pylintrc手动禁用所有东西?在


Tags: 方法警告过程时间模式情况经验手动
2条回答

禁用所有检查,然后显式启用所需的检查。例如:

pylint  score=no  disable=all  enable=unused-argument whatever.py

pylint docs

If you want to enable only some checkers or some message symbols, first use disable=all then enable=<symbol> with being a comma separated list of checker names and message symbols. See the list of available features for a description of provided checkers with their functionalities.

相关问题 更多 >