Commits

Steven Kryskalla committed 85a4462

adding warning codes W402..405 and W801..806 to pyflakes messages

Comments (0)

Files changed (1)

flake8/messages.py

 
 
 class UnusedImport(Message):
-    message = '%r imported but unused'
+    message = 'W402 %r imported but unused'
 
     def __init__(self, filename, lineno, name):
         Message.__init__(self, filename, lineno)
 
 
 class RedefinedWhileUnused(Message):
-    message = 'redefinition of unused %r from line %r'
+    message = 'W801 redefinition of unused %r from line %r'
 
     def __init__(self, filename, lineno, name, orig_lineno):
         Message.__init__(self, filename, lineno)
 
 
 class ImportShadowedByLoopVar(Message):
-    message = 'import %r from line %r shadowed by loop variable'
+    message = 'W403 import %r from line %r shadowed by loop variable'
 
     def __init__(self, filename, lineno, name, orig_lineno):
         Message.__init__(self, filename, lineno)
 
 
 class ImportStarUsed(Message):
-    message = "'from %s import *' used; unable to detect undefined names"
+    message = "W404 'from %s import *' used; unable to detect undefined names"
 
     def __init__(self, filename, lineno, modname):
         Message.__init__(self, filename, lineno)
 
 
 class UndefinedName(Message):
-    message = 'undefined name %r'
+    message = 'W802 undefined name %r'
 
     def __init__(self, filename, lineno, name):
         Message.__init__(self, filename, lineno)
 
 
 class UndefinedExport(Message):
-    message = 'undefined name %r in __all__'
+    message = 'W803 undefined name %r in __all__'
 
     def __init__(self, filename, lineno, name):
         Message.__init__(self, filename, lineno)
 
 
 class UndefinedLocal(Message):
-    message = "local variable %r (defined in enclosing scope on line %r) " \
-            "referenced before assignment"
+    message = "W804 local variable %r (defined in enclosing scope on line " \
+            "%r) referenced before assignment"
 
     def __init__(self, filename, lineno, name, orig_lineno):
         Message.__init__(self, filename, lineno)
 
 
 class DuplicateArgument(Message):
-    message = 'duplicate argument %r in function definition'
+    message = 'W805 duplicate argument %r in function definition'
 
     def __init__(self, filename, lineno, name):
         Message.__init__(self, filename, lineno)
 
 
 class RedefinedFunction(Message):
-    message = 'redefinition of function %r from line %r'
+    message = 'W806 redefinition of function %r from line %r'
 
     def __init__(self, filename, lineno, name, orig_lineno):
         Message.__init__(self, filename, lineno)
 
 
 class LateFutureImport(Message):
-    message = 'future import(s) %r after other statements'
+    message = 'W405 future import(s) %r after other statements'
 
     def __init__(self, filename, lineno, names):
         Message.__init__(self, filename, lineno)
     used.
     """
 
-    message = 'local variable %r is assigned to but never used'
+    message = 'W806 local variable %r is assigned to but never used'
 
     def __init__(self, filename, lineno, names):
         Message.__init__(self, filename, lineno)