ACME: pylint lint plugin

This commit is contained in:
Jakub Warmuz
2015-02-06 22:54:28 +00:00
parent ec4dc6905f
commit 13128464aa
2 changed files with 21 additions and 1 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ persistent=yes
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
load-plugins=letsencrypt.acme.lint
[MESSAGES CONTROL]
+20
View File
@@ -0,0 +1,20 @@
"""Let's Encrypt 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):
if (('Message' in cls.basenames or 'ImmutableMap' in cls.basenames or
'util.ImmutableMap' in cls.basenames) and (cls.slots() is not None)):
for slot in cls.slots():
cls.locals[slot.value] = [nodes.EmptyNode()]
MANAGER.register_transform(nodes.Class, _transform)