summaryrefslogtreecommitdiff
path: root/examples/custom.py
diff options
context:
space:
mode:
authorDavid Douard <david.douard@logilab.fr>2013-06-17 15:06:48 +0200
committerDavid Douard <david.douard@logilab.fr>2013-06-17 15:06:48 +0200
commitf1786ae74b5f22913c00e80deaacd7870f5e3d7e (patch)
treeb113d8e035aaca7562ea64384955ec6d806841ef /examples/custom.py
parentd463a2b7bd376ed11d270903760b6a9ac762ef21 (diff)
downloadpylint-git-f1786ae74b5f22913c00e80deaacd7870f5e3d7e.tar.gz
astng has been renamed astroid
Diffstat (limited to 'examples/custom.py')
-rw-r--r--examples/custom.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/custom.py b/examples/custom.py
index 7e4d5e76b..2537bade7 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))