summaryrefslogtreecommitdiff
path: root/checkers/newstyle.py
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2014-04-14 11:55:57 +0200
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2014-04-14 11:55:57 +0200
commit93e8ce9fddbdd0efa6b94e7edc79b2bc739d69b3 (patch)
tree8d39a5af1ee5a4401c0072d93555b0696f87a9b3 /checkers/newstyle.py
parent16cf3596fca82978b326436201b869f1fcc92763 (diff)
downloadpylint-93e8ce9fddbdd0efa6b94e7edc79b2bc739d69b3.tar.gz
use symbolic names in the newstyle checker
Diffstat (limited to 'checkers/newstyle.py')
-rw-r--r--checkers/newstyle.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/checkers/newstyle.py b/checkers/newstyle.py
index e583126..88ed92d 100644
--- a/checkers/newstyle.py
+++ b/checkers/newstyle.py
@@ -67,19 +67,19 @@ class NewStyleConflictChecker(BaseChecker):
# configuration options
options = ()
- @check_messages('E1001', 'C1001')
+ @check_messages('slots-on-old-class', 'old-style-class')
def visit_class(self, node):
"""check __slots__ usage
"""
if '__slots__' in node and not node.newstyle:
- self.add_message('E1001', node=node)
+ self.add_message('slots-on-old-class', node=node)
# The node type could be class, exception, metaclass, or
# interface. Presumably, the non-class-type nodes would always
# have an explicit base class anyway.
if not node.bases and node.type == 'class':
- self.add_message('C1001', node=node)
+ self.add_message('old-style-class', node=node)
- @check_messages('W1001')
+ @check_messages('property-on-old-class')
def visit_callfunc(self, node):
"""check property usage"""
parent = node.parent.frame()
@@ -88,9 +88,9 @@ class NewStyleConflictChecker(BaseChecker):
isinstance(node.func, astroid.Name)):
name = node.func.name
if name == 'property':
- self.add_message('W1001', node=node)
+ self.add_message('property-on-old-class', node=node)
- @check_messages('E1002', 'E1003', 'E1004')
+ @check_messages('super-on-old-class', 'bad-super-call', 'missing-super-argument')
def visit_function(self, node):
"""check use of super"""
# ignore actual functions or method within a new style class
@@ -108,7 +108,7 @@ class NewStyleConflictChecker(BaseChecker):
call.func.name == 'super':
if not klass.newstyle:
# super should not be used on an old style class
- self.add_message('E1002', node=node)
+ self.add_message('super-on-old-class', node=node)
else:
# super first arg should be the class
if not call.args and sys.version_info[0] == 3:
@@ -126,7 +126,7 @@ class NewStyleConflictChecker(BaseChecker):
continue
if klass is not supcls:
- self.add_message('E1003', node=call,
+ self.add_message('bad-super-call', node=call,
args=(call.args[0].name, ))