--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/translations.py Tue Sep 17 19:23:27 2019 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/translations.py Tue Sep 17 19:43:17 2019 +0200 @@ -15,6 +15,9 @@ __all__ = ["getTranslatedMessage"] _messages = { + ################################################################## + ## pycodestyle messages + ################################################################## "E101": QCoreApplication.translate( "pycodestyle", "indentation contains mixed spaces and tabs"), @@ -278,8 +281,10 @@ "E902": QCoreApplication.translate( "pycodestyle", "{0}"), - - # DocStyleChecker messages + + ################################################################## + ## DocStyleChecker messages + ################################################################## "D101": QCoreApplication.translate( "DocStyleChecker", "module is missing a docstring"), "D102": QCoreApplication.translate( @@ -420,8 +425,10 @@ "D901": QCoreApplication.translate( "DocStyleChecker", "{0}: {1}"), - - # NamingStyleChecker messages + + ################################################################## + ## NamingStyleChecker messages + ################################################################## "N801": QCoreApplication.translate( "NamingStyleChecker", "class names should use CapWords convention"), @@ -465,8 +472,10 @@ "N831": QCoreApplication.translate( "NamingStyleChecker", "names 'l', 'O' and 'I' should be avoided"), - - # Code complexity messages + + ################################################################## + ## Code complexity messages + ################################################################## "C101": QCoreApplication.translate( "ComplexityChecker", "'{0}' is too complex ({1})"), "C111": QCoreApplication.translate( @@ -477,7 +486,9 @@ "C901": QCoreApplication.translate( "ComplexityChecker", "{0}: {1}"), - # Messages of the Miscellaneous Checker + ################################################################## + ## Messages of the Miscellaneous Checker + ################################################################## "M101": QCoreApplication.translate( "MiscellaneousChecker", "coding magic comment not found"), @@ -498,33 +509,53 @@ "MiscellaneousChecker", '"{0}" is used as an argument and thus shadows a ' 'Python builtin; consider renaming the argument'), - "M191": QCoreApplication.translate( + "M181": QCoreApplication.translate( "MiscellaneousChecker", 'unnecessary generator - rewrite as a list comprehension'), - "M192": QCoreApplication.translate( + "M182": QCoreApplication.translate( "MiscellaneousChecker", 'unnecessary generator - rewrite as a set comprehension'), - "M193": QCoreApplication.translate( + "M183": QCoreApplication.translate( "MiscellaneousChecker", 'unnecessary generator - rewrite as a dict comprehension'), - "M194": QCoreApplication.translate( + "M184": QCoreApplication.translate( "MiscellaneousChecker", 'unnecessary list comprehension - rewrite as a set comprehension'), + "M185": QCoreApplication.translate( + "MiscellaneousChecker", + 'unnecessary list comprehension - rewrite as a dict comprehension'), + "M186": QCoreApplication.translate( + "MiscellaneousChecker", + 'unnecessary {0} call - rewrite as a literal'), + "M187": QCoreApplication.translate( + "MiscellaneousChecker", + 'unnecessary list comprehension - "{0}" can take a generator'), + "M191": QCoreApplication.translate( + "MiscellaneousChecker", + 'unnecessary {0} literal - rewrite as a {1} literal'), + "M192": QCoreApplication.translate( + "MiscellaneousChecker", + 'unnecessary {0} passed to tuple() - rewrite as a {1} literal'), + "M193": QCoreApplication.translate( + "MiscellaneousChecker", + 'unnecessary {0} passed to list() - rewrite as a {1} literal'), "M195": QCoreApplication.translate( "MiscellaneousChecker", - 'unnecessary list comprehension - rewrite as a dict comprehension'), + 'unnecessary list call - remove the outer call to list()'), "M196": QCoreApplication.translate( "MiscellaneousChecker", - 'unnecessary list literal - rewrite as a set literal'), + 'unnecessary list comprehension - "in" can take a generator'), "M197": QCoreApplication.translate( "MiscellaneousChecker", - 'unnecessary list literal - rewrite as a dict literal'), + 'unnecessary {0} passed to tuple() - remove the outer call to {1}()'), "M198": QCoreApplication.translate( "MiscellaneousChecker", - 'unnecessary list comprehension - "{0}" can take a generator'), + 'unnecessary {0} passed to list() - remove the outer call to {1}()'), + "M201": QCoreApplication.translate( "MiscellaneousChecker", "sort keys - '{0}' should be before '{1}'"), + "M301": QCoreApplication.translate( "MiscellaneousChecker", "use of 'datetime.datetime()' without 'tzinfo' argument should be" @@ -578,6 +609,42 @@ "MiscellaneousChecker", "use of 'datetime.time()' without 'tzinfo' argument should be" " avoided"), + + "M401": QCoreApplication.translate( + "MiscellaneousChecker", + "'sys.version[:3]' referenced (Python 3.10), use 'sys.version_info'"), + "M402": QCoreApplication.translate( + "MiscellaneousChecker", + "'sys.version[2]' referenced (Python 3.10), use 'sys.version_info'"), + "M403": QCoreApplication.translate( + "MiscellaneousChecker", + "'sys.version' compared to string (Python 3.10), use" + " 'sys.version_info'"), + "M411": QCoreApplication.translate( + "MiscellaneousChecker", + "'sys.version_info[0] == 3' referenced (Python 4), use '>='"), + "M412": QCoreApplication.translate( + "MiscellaneousChecker", + "'six.PY3' referenced (Python 4), use 'not six.PY2'"), + "M413": QCoreApplication.translate( + "MiscellaneousChecker", + "'sys.version_info[1]' compared to integer (Python 4)," + " compare 'sys.version_info' to tuple"), + "M414": QCoreApplication.translate( + "MiscellaneousChecker", + "'sys.version_info.minor' compared to integer (Python 4)," + " compare 'sys.version_info' to tuple"), + "M421": QCoreApplication.translate( + "MiscellaneousChecker", + "'sys.version[0]' referenced (Python 10), use 'sys.version_info'"), + "M422": QCoreApplication.translate( + "MiscellaneousChecker", + "'sys.version' compared to string (Python 10)," + " use 'sys.version_info'"), + "M423": QCoreApplication.translate( + "MiscellaneousChecker", + "'sys.version[:1]' referenced (Python 10), use 'sys.version_info'"), + "M501": QCoreApplication.translate( "MiscellaneousChecker", "Python does not support the unary prefix increment"), @@ -631,6 +698,7 @@ "MiscellaneousChecker", "'__metaclass__' does nothing on Python 3 -" " use 'class MyClass(BaseClass, metaclass=...)'"), + "M601": QCoreApplication.translate( "MiscellaneousChecker", "found {0} formatter"), @@ -679,6 +747,7 @@ "M655": QCoreApplication.translate( "MiscellaneousChecker", "logging statement uses 'warn' instead of 'warning'"), + "M701": QCoreApplication.translate( "MiscellaneousChecker", "expected these __future__ imports: {0}; but only got: {1}"), @@ -688,6 +757,7 @@ "M711": QCoreApplication.translate( "MiscellaneousChecker", "gettext import with alias _ found: {0}"), + "M801": QCoreApplication.translate( "MiscellaneousChecker", "print statement found"), @@ -726,11 +796,14 @@ "M891": QCoreApplication.translate( "MiscellaneousChecker", "commented code lines should be removed"), + "M901": QCoreApplication.translate( "MiscellaneousChecker", "{0}: {1}"), - # CodeStyleFixer messages + ################################################################## + ## CodeStyleFixer messages + ################################################################## "FD111": QCoreApplication.translate( 'CodeStyleFixer', "Triple single quotes converted to triple double quotes."), @@ -905,20 +978,29 @@ "E743": ["l"], "E901": ["SyntaxError", "Invalid Syntax"], "E902": ["IOError"], + "D232": ["public"], "D252": ["RuntimeError"], "D253": ["RuntimeError"], "D262": ["buttonClicked"], "D263": ["buttonClicked"], "D901": ["SyntaxError", "Invalid Syntax"], + "C101": ["foo.bar", "42"], "C111": [42], "C112": [12.0], "C901": ["SyntaxError", "Invalid Syntax"], + "M102": ["enc42"], "M131": ["list"], "M132": ["list"], - "M198": ["sorted"], + "M188": ["sorted"], + "M186": ["list"], + "M191": ["list", "set"], + "M192": ["list", "tuple"], + "M193": ["tuple", "list"], + "M197": ["tuple", "tuple"], + "M198": ["list", "list"], "M201": ["bar", "foo"], "M507": ["x"], "M601": ["%s"], @@ -933,6 +1015,7 @@ "M822": ["Call"], "M823": ["dict"], "M901": ["SyntaxError", "Invalid Syntax"], + "FWRITE_ERROR": ["IOError"], }