diff options
author | David Douard <david.douard@logilab.fr> | 2013-06-17 15:06:48 +0200 |
---|---|---|
committer | David Douard <david.douard@logilab.fr> | 2013-06-17 15:06:48 +0200 |
commit | 34e999fc8d56fdeadda39bb8f7122e203af7d869 (patch) | |
tree | 85c406f60ea59578241ac0959591720d07fa0fda /examples | |
parent | b4a281669859719bf13e01b81c6d979fcc0ea2d7 (diff) | |
download | pylint-34e999fc8d56fdeadda39bb8f7122e203af7d869.tar.gz |
astng has been renamed astroid
Diffstat (limited to 'examples')
-rw-r--r-- | examples/custom.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/custom.py b/examples/custom.py index 7e4d5e7..2537bad 100644 --- a/examples/custom.py +++ b/examples/custom.py @@ -1,14 +1,14 @@ -from logilab import astng +import astroid -from pylint.interfaces import IASTNGChecker +from pylint.interfaces import IAstroidChecker from pylint.checkers import BaseChecker -class MyASTNGChecker(BaseChecker): +class MyAstroidChecker(BaseChecker): """add member attributes defined using my own "properties" function to the class locals dictionary """ - __implements__ = IASTNGChecker + __implements__ = IAstroidChecker name = 'custom' msgs = {} @@ -19,9 +19,9 @@ class MyASTNGChecker(BaseChecker): def visit_callfunc(self, node): """called when a CallFunc node is encountered. - See logilab.astng for the description of available nodes.""" - if not (isinstance(node.func, astng.Getattr) - and isinstance(node.func.expr, astng.Name) + See astroid for the description of available nodes.""" + if not (isinstance(node.func, astroid.Getattr) + and isinstance(node.func.expr, astroid.Name) and node.func.expr.name == 'properties' and node.func.attrname == 'create'): return @@ -32,5 +32,5 @@ class MyASTNGChecker(BaseChecker): def register(linter): """required method to auto register this checker""" - linter.register_checker(MyASTNGChecker(linter)) + linter.register_checker(MyAstroidChecker(linter)) |