diff options
author | cpopa <devnull@localhost> | 2013-08-01 16:19:49 +0300 |
---|---|---|
committer | cpopa <devnull@localhost> | 2013-08-01 16:19:49 +0300 |
commit | eab32695c40e3435def1465cb2aa5d39ce32ba09 (patch) | |
tree | fe74b5d1fea85cf5e3a90bcc8e66844bea6c7a83 | |
parent | e7df34f29b5c611005fd69e60c090d5cda316b3c (diff) | |
download | pylint-eab32695c40e3435def1465cb2aa5d39ce32ba09.tar.gz |
Combine exec-function with exec-statement, rename test files.
-rw-r--r-- | checkers/base.py | 20 | ||||
-rw-r--r-- | test/input/func_exec_used_py30.py (renamed from test/input/func_exec_function_py30.py) | 0 | ||||
-rw-r--r-- | test/messages/func_exec_function_py30.txt | 4 | ||||
-rw-r--r-- | test/messages/func_exec_used_py30.txt | 4 | ||||
-rw-r--r-- | test/messages/func_w0122_py_30.txt | 8 |
5 files changed, 15 insertions, 21 deletions
diff --git a/checkers/base.py b/checkers/base.py index ff472ec..ac58114 100644 --- a/checkers/base.py +++ b/checkers/base.py @@ -374,16 +374,10 @@ functions, methods 'duplicate-key', "Used when a dictionary expression binds the same key multiple \ times."), - 'W0122': ('Use of the exec statement', - 'exec-statement', + 'W0122': ('Use of exec', + 'exec-used', 'Used when you use the "exec" statement, to discourage its \ - usage. That doesn\'t mean you can not use it !', - {'maxversion': (3, 0)}), - 'W0123': ('Use of the exec function', - 'exec-function', - 'Used when you use the "exec" function, to discourage its \ - usage. That doesn\'t mean you can not use it !', - {'minversion': (3, 0)}), + usage. That doesn\'t mean you can not use it !'), 'W0141': ('Used builtin function %r', 'bad-builtin', 'Used when a black listed builtin function is used (see the ' @@ -599,12 +593,12 @@ functions, methods if node.exc is not None and node.inst is not None and node.tback is None: self.add_message('old-raise-syntax', node=node) - @check_messages('exec-statement') + @check_messages('exec-used') def visit_exec(self, node): """just print a warning on exec statements""" - self.add_message('exec-statement', node=node) + self.add_message('exec-used', node=node) - @check_messages('bad-builtin', 'star-args', 'exec-function') + @check_messages('bad-builtin', 'star-args', 'exec-used') def visit_callfunc(self, node): """visit a CallFunc node -> check if this is not a blacklisted builtin call and check for * or ** use @@ -616,7 +610,7 @@ functions, methods if not (name in node.frame() or name in node.root()): if name == 'exec': - self.add_message('exec-function', node=node) + self.add_message('exec-used', node=node) if name in self.config.bad_functions: self.add_message('bad-builtin', node=node, args=name) if node.starargs or node.kwargs: diff --git a/test/input/func_exec_function_py30.py b/test/input/func_exec_used_py30.py index dbcc024..dbcc024 100644 --- a/test/input/func_exec_function_py30.py +++ b/test/input/func_exec_used_py30.py diff --git a/test/messages/func_exec_function_py30.txt b/test/messages/func_exec_function_py30.txt deleted file mode 100644 index a867b82..0000000 --- a/test/messages/func_exec_function_py30.txt +++ /dev/null @@ -1,4 +0,0 @@ -W: 5: Use of the exec function
-W: 6: Use of the exec function
-W: 8: Use of the exec function
-W: 12:func: Use of the exec function
diff --git a/test/messages/func_exec_used_py30.txt b/test/messages/func_exec_used_py30.txt new file mode 100644 index 0000000..362da68 --- /dev/null +++ b/test/messages/func_exec_used_py30.txt @@ -0,0 +1,4 @@ +W: 5: Use of exec
+W: 6: Use of exec
+W: 8: Use of exec
+W: 12:func: Use of exec
diff --git a/test/messages/func_w0122_py_30.txt b/test/messages/func_w0122_py_30.txt index 1522cac..d833076 100644 --- a/test/messages/func_w0122_py_30.txt +++ b/test/messages/func_w0122_py_30.txt @@ -1,5 +1,5 @@ -W: 5: Use of the exec statement -W: 6: Use of the exec statement -W: 8: Use of the exec statement -W: 12:func: Use of the exec statement +W: 5: Use of exec +W: 6: Use of exec +W: 8: Use of exec +W: 12:func: Use of exec |