summaryrefslogtreecommitdiff
path: root/examples
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
commit34e999fc8d56fdeadda39bb8f7122e203af7d869 (patch)
tree85c406f60ea59578241ac0959591720d07fa0fda /examples
parentb4a281669859719bf13e01b81c6d979fcc0ea2d7 (diff)
downloadpylint-34e999fc8d56fdeadda39bb8f7122e203af7d869.tar.gz
astng has been renamed astroid
Diffstat (limited to 'examples')
-rw-r--r--examples/custom.py16
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))