1 Star 0 Fork 0

清风洗雨 / certbot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
linter_plugin.py 813 Bytes
一键复制 编辑 原始数据 按行查看 历史
Brad Warren 提交于 2016-04-14 10:20 . Rename misc files
"""Certbot ACME PyLint plugin.
http://docs.pylint.org/plugins.html
"""
from astroid import MANAGER
from astroid import nodes
def register(unused_linter):
"""Register this module as PyLint plugin."""
def _transform(cls):
# fix the "no-member" error on instances of
# letsencrypt.acme.util.ImmutableMap subclasses (instance
# attributes are initialized dynamically based on __slots__)
# TODO: this is too broad and applies to any tested class...
if cls.slots() is not None:
for slot in cls.slots():
cls.locals[slot.value] = [nodes.EmptyNode()]
if cls.name == 'JSONObjectWithFields':
# _fields is magically introduced by JSONObjectWithFieldsMeta
cls.locals['_fields'] = [nodes.EmptyNode()]
MANAGER.register_transform(nodes.Class, _transform)
1
https://gitee.com/nor_dt/certbot.git
git@gitee.com:nor_dt/certbot.git
nor_dt
certbot
certbot
master

搜索帮助