diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-12-09 11:01:07 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-12-09 11:01:07 +0100 |
commit | 88843a2115897df1b7431240eaa2196e766a4b46 (patch) | |
tree | d8e10e63f403d6dff27e1164dc73b33c32211261 /checkers/utils.py | |
parent | 355d743290964213e8e1978e1c0200ecb5cd44d2 (diff) | |
download | pylint-88843a2115897df1b7431240eaa2196e766a4b46.tar.gz |
messages: add "check_messages" decorator to store messages
refactor PyLintASTWalker.add_checker to check the stored method's messages;
in PyLintASTWalker.add_checker, we only disable methods
that has been decorated and have no activated message.
Diffstat (limited to 'checkers/utils.py')
-rw-r--r-- | checkers/utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/checkers/utils.py b/checkers/utils.py index 94ac8b0..1cbd006 100644 --- a/checkers/utils.py +++ b/checkers/utils.py @@ -202,3 +202,12 @@ PYMETHODS = set(('__new__', '__init__', '__del__', '__hash__', '__xor__', '__ixor__', '__rxor__', # XXX To be continued )) + +def check_messages(*messages): + """decorator to store messages that are handled by a checker method""" + + def store_messages(func): + func.checks_msgs = messages + return func + return store_messages + |