summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Yves David <pierre-yves.david@logilab.fr>2009-11-25 13:08:36 +0100
committerPierre-Yves David <pierre-yves.david@logilab.fr>2009-11-25 13:08:36 +0100
commit626ced0d14ffb87d00e21cb30ea0cb49d24be44f (patch)
tree50f1273fcd9ce3b9d76572690ce6a5e84fff4a7b
parent36526689ffac94ef4459a34e781caa66ed3a9815 (diff)
downloadpylint-626ced0d14ffb87d00e21cb30ea0cb49d24be44f.tar.gz
Merge two ++ and -- messages in a single one
-rwxr-xr-xcheckers/base.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/checkers/base.py b/checkers/base.py
index 3386618..8045656 100755
--- a/checkers/base.py
+++ b/checkers/base.py
@@ -119,12 +119,9 @@ MSGS = {
'Used when a "return" statement with an argument is found '
'outside in a generator function or method (e.g. with some '
'"yield" statements).'),
- 'E0107': ("Use of the non-existent ++ operator",
- "Used when you attempt to use the C-style pre-increment operator "
- "(++), which doesn't exist in Python."),
- 'E0108': ("Use of the non-existent -- operator",
- "Used when you attempt to use the C-style pre-increment operator "
- "(--), which doesn't exist in Python."),
+ 'E0107': ("Use of the non-existent %s operator",
+ "Used when you attempt to use the C-style pre-increment or"
+ "pre-decrement operator -- and ++, which doesn't exist in Python."),
'W0101': ('Unreachable code',
'Used when there is some code behind a "return" or "raise" \
statement, which will never be accessed.'),
@@ -546,9 +543,7 @@ functions, methods
if ((node.op in '+-') and
isinstance(node.operand, astng.UnaryOp) and
(node.operand.op == node.op)):
- message = { '+': 'E0107',
- '-': 'E0108',}[node.op]
- self.add_message(message, node=node)
+ self.add_message('E0107', node=node, args=node.op*2)
def visit_dict(self, node):
"""check duplicate key in dictionary"""