如何禁用“TODO"pylint 中的警告? [英] How do I disable "TODO" warnings in pylint?

查看:57
本文介绍了如何禁用“TODO"pylint 中的警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 python 文件上运行 pylint 时,它默认显示有关 TODO 注释的警告.例如:

When running pylint on a python file it shows me warnings regarding TODO comments by default. E.g.:

**************** 模块 foo
W:200, 0: TODO(SE): 解决这个问题!(修复)
W:294, 0: TODO(SE): backlog item (fixme)
W:412, 0: TODO(SE): 删除存储桶?(修复)

************* Module foo
W:200, 0: TODO(SE): fix this! (fixme)
W:294, 0: TODO(SE): backlog item (fixme)
W:412, 0: TODO(SE): Delete bucket? (fixme)

虽然我确实发现这种行为很有用,但我想知道一种暂时和/或永久打开或关闭这些特定警告的方法.

While I do find this behavior useful, I would like to know of a way of temporarily and/or permanently turn these specific warnings on or off.

我能够生成一个 pylint 配置文件:pylint --generate-rcfile >~/.pylintrc

I am able to generate a pylint config file: pylint --generate-rcfile > ~/.pylintrc

我只是确定要在此文件中放置什么以禁用 TODO 注释的警告.

I'm just note sure what to put in this file to disable warnings for TODO comments.

推荐答案

在生成的配置文件中,你应该看到一个部分

in the generated config file, you should see a section

  [MISCELLANEOUS]

  # List of note tags to take in consideration, separated by a comma.
  notes=FIXME,XXX,TODO

只需从笔记"列表中删除 TODO.

simply drop TODO from the "notes" list.

配置文件位于

~/.pylintrc

如果你还没有生成配置文件,这可以用

If you have not generated the config file, this can be done with

pylint --generate-rcfile > ~/.pylintrc

这篇关于如何禁用“TODO"pylint 中的警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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