diff options
Diffstat (limited to 'checkers/python3.py')
-rw-r--r-- | checkers/python3.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/checkers/python3.py b/checkers/python3.py index e8609a0..d83709f 100644 --- a/checkers/python3.py +++ b/checkers/python3.py @@ -18,6 +18,7 @@ import tokenize import astroid from pylint import checkers, interfaces +from pylint.utils import WarningScope from pylint.checkers import utils def _check_dict_node(node): @@ -67,6 +68,13 @@ class Python3Checker(checkers.BaseChecker): "instead of 'raise foo(bar)'.", {'maxversion': (3, 0), 'old_names': [('W0121', 'old-raise-syntax')]}), + 'E1606': ('Use of the `` operator', + 'backtick', + 'Used when the deprecated "``" (backtick) operator is used ' + 'instead of the str() function.', + {'scope': WarningScope.NODE, + 'maxversion': (3, 0), + 'old_names': [('W0333', 'backtick')]}), 'W1601': ('apply built-in referenced', 'apply-builtin', 'Used when the apply built-in function is referenced ' @@ -316,6 +324,10 @@ class Python3Checker(checkers.BaseChecker): if isinstance(node.name, (astroid.Tuple, astroid.List)): self.add_message('unpacking-in-except', node=node) + @utils.check_messages('backtick') + def visit_backquote(self, node): + self.add_message('backtick', node=node) + @utils.check_messages('raising-string', 'old-raise-syntax') def visit_raise(self, node): """Visit a raise statement and check for raising |