diff options
| author | Emile Anclin <emile.anclin@logilab.fr> | 2010-12-09 11:34:00 +0100 |
|---|---|---|
| committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-12-09 11:34:00 +0100 |
| commit | 545ffeff2904fc9c8672b8b575dc894a29ffb8db (patch) | |
| tree | 6c0958df05a096fe2e265c80c3b4602f695574d2 /checkers/variables.py | |
| parent | 76e39f215f21177860c987ee2a09c7e3e91e585b (diff) | |
| download | pylint-git-545ffeff2904fc9c8672b8b575dc894a29ffb8db.tar.gz | |
messages: decorate visit and leave methods with check_messages
refactor checker/bases.py while adding 'check_messages'
Diffstat (limited to 'checkers/variables.py')
| -rw-r--r-- | checkers/variables.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/checkers/variables.py b/checkers/variables.py index b292a2103..d7ebcc8e8 100644 --- a/checkers/variables.py +++ b/checkers/variables.py @@ -23,9 +23,9 @@ from logilab.astng import are_exclusive, builtin_lookup from pylint.interfaces import IASTNGChecker from pylint.checkers import BaseChecker -from pylint.checkers.utils import PYMETHODS, is_ancestor_name, is_builtin, \ - is_defined_before, is_error, is_func_default, is_func_decorator, assign_parent - +from pylint.checkers.utils import (PYMETHODS, is_ancestor_name, is_builtin, + is_defined_before, is_error, is_func_default, is_func_decorator, + assign_parent, check_messages) def overridden_method(klass, name): """get overridden method if any""" @@ -136,6 +136,7 @@ builtins. Remember that you should avoid to define new builtins when possible.' # do not print Redefining builtin for additional builtins self.add_message('W0622', args=name, node=stmts[0]) + @check_messages('W0611', 'W0614') def leave_module(self, node): """leave module: check globals """ @@ -269,6 +270,7 @@ builtins. Remember that you should avoid to define new builtins when possible.' else: self.add_message('W0612', args=name, node=stmt) + @check_messages('W0601', 'W0602', 'W0603', 'W0604', 'W0622') def visit_global(self, node): """check names imported exists in the global scope""" frame = node.frame() |
