diff options
author | Jakub Warmuz <jakub@warmuz.org> | 2015-02-08 15:22:16 +0300 |
---|---|---|
committer | Jakub Warmuz <jakub@warmuz.org> | 2015-02-08 15:22:16 +0300 |
commit | bcb92243017e46c4aa342f55f065947ce1e2d292 (patch) | |
tree | 7a1c38721af4b9657ec982455fa227a2e33017c6 /linter_plugin.py | |
parent | ec3bb4cf139e7c64b0054aef7f4660e788eca403 (diff) |
Fix "lint" and "providedBy" build errors
Diffstat (limited to 'linter_plugin.py')
-rw-r--r-- | linter_plugin.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/linter_plugin.py b/linter_plugin.py new file mode 100644 index 000000000..63f75d69d --- /dev/null +++ b/linter_plugin.py @@ -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) |