Pylint ignore specific names [duplicate]

孤街醉人 提交于 2019-12-01 17:34:24

问题


I have a problem with pylint, i.e. sometimes it repeats the same message for some variable/class/module etc. and I can't find a workaround for that. What I want is to say pylint "don't check [message XXX|any message] for variable YYY in [this module|module "ZZZ"]" with some option or rcfile directive.


回答1:


What you are asking for is not supported in the current version of Pylint.

You may want to get in touch with the maintainers and propose them a feature request and an implementation.




回答2:


According to the docs you enable and disable messages using lines like:

# pylint: disable=W0631

in the python code.




回答3:


There's good-names=YYY for this, or for some advanced stuff you can modify the regex via variable-rgx.



来源:https://stackoverflow.com/questions/14233867/pylint-ignore-specific-names

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!