--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/translations.py Mon Oct 12 19:28:42 2020 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/translations.py Mon Oct 12 19:54:03 2020 +0200 @@ -12,6 +12,12 @@ from .Security.translations import ( _securityMessages, _securityMessagesSampleArgs ) +from .Annotations.translations import ( + _annotationsMessages, _annotationsMessagesSampleArgs +) +from .Complexity.translations import ( + _complexityMessages, _complexityMessagesSampleArgs +) # TODO: separate this huge dict into separate translations per checker type _messages = { @@ -471,19 +477,6 @@ "names 'l', 'O' and 'I' should be avoided"), ################################################################## - ## Code complexity messages - ################################################################## - "C101": QCoreApplication.translate( - "ComplexityChecker", "'{0}' is too complex ({1})"), - "C111": QCoreApplication.translate( - "ComplexityChecker", "source code line is too complex ({0})"), - "C112": QCoreApplication.translate( - "ComplexityChecker", - "overall source code line complexity is too high ({0})"), - "C901": QCoreApplication.translate( - "ComplexityChecker", "{0}: {1}"), - - ################################################################## ## Messages of the Miscellaneous Checker ################################################################## "M101": QCoreApplication.translate( @@ -798,56 +791,6 @@ "MiscellaneousChecker", "{0}: {1}"), - - ################################################################## - ## Messages of the Annotations Checker - ################################################################## - "A001": QCoreApplication.translate( - "AnnotationsChecker", - "missing type annotation for function argument '{0}'"), - "A002": QCoreApplication.translate( - "AnnotationsChecker", - "missing type annotation for '*{0}'"), - "A003": QCoreApplication.translate( - "AnnotationsChecker", - "missing type annotation for '**{0}'"), - "A101": QCoreApplication.translate( - "AnnotationsChecker", - "missing type annotation for 'self' in method"), - "A102": QCoreApplication.translate( - "AnnotationsChecker", - "missing type annotation for 'cls' in classmethod"), - "A201": QCoreApplication.translate( - "AnnotationsChecker", - "missing return type annotation for public function"), - "A202": QCoreApplication.translate( - "AnnotationsChecker", - "missing return type annotation for protected function"), - "A203": QCoreApplication.translate( - "AnnotationsChecker", - "missing return type annotation for private function"), - "A204": QCoreApplication.translate( - "AnnotationsChecker", - "missing return type annotation for special method"), - "A205": QCoreApplication.translate( - "AnnotationsChecker", - "missing return type annotation for staticmethod"), - "A206": QCoreApplication.translate( - "AnnotationsChecker", - "missing return type annotation for classmethod"), - - "A881": QCoreApplication.translate( - "AnnotationsChecker", - "type annotation coverage of {0}% is too low"), - - "A891": QCoreApplication.translate( - "AnnotationsChecker", - "type annotation is too complex ({0} > {1})"), - - "A999": QCoreApplication.translate( - "AnnotationsChecker", - "{0}: {1}"), - ################################################################## ## CodeStyleFixer messages ################################################################## @@ -1034,11 +977,6 @@ "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"], @@ -1064,24 +1002,21 @@ "M823": ["dict"], "M901": ["SyntaxError", "Invalid Syntax"], - "A001": ["arg1"], - "A002": ["args"], - "A003": ["kwargs"], - "A881": [60], - "A891": [5, 3], - "A999": ["SyntaxError", "Invalid Syntax"], - "FIXWRITE_ERROR": ["IOError"], } messageCatalogs = ( _messages, _securityMessages, + _annotationsMessages, + _complexityMessages, ) messageSampleArgsCatalog = ( _messages_sample_args, _securityMessagesSampleArgs, + _annotationsMessagesSampleArgs, + _complexityMessagesSampleArgs, )