Sat, 17 Apr 2021 12:37:41 +0200
Updated source docu.
--- a/eric6/APIs/Python3/eric6.api Sat Apr 17 12:36:40 2021 +0200 +++ b/eric6/APIs/Python3/eric6.api Sat Apr 17 12:37:41 2021 +0200 @@ -3097,12 +3097,46 @@ eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.AnnotationsChecker.Codes?7 eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.AnnotationsChecker.run?4() eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.AnnotationsChecker?1(source, filename, tree, select, ignore, expected, repeat, args) -eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.FunctionVisitor.visit_AsyncFunctionDef?4(node) -eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.FunctionVisitor.visit_ClassDef?4(node) -eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.FunctionVisitor.visit_FunctionDef?4(node) -eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.FunctionVisitor?1(sourceLines) -eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.getAnnotationComplexity?4(annotationNode) -eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.hasTypeAnnotations?4(funcNode) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsCheckerDefaults.AnnotationsCheckerDefaultArgs?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.AnnotationType.ARGS?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.AnnotationType.KWARG?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.AnnotationType.KWONLYARGS?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.AnnotationType.POSONLYARGS?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.AnnotationType.RETURN?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.AnnotationType.VARARG?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.ClassDecoratorType.CLASSMETHOD?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.ClassDecoratorType.STATICMETHOD?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.FunctionType.PRIVATE?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.FunctionType.PROTECTED?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.FunctionType.PUBLIC?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.FunctionType.SPECIAL?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.AST_ARG_TYPES?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Argument.fromNode?4(node, annotationTypeName) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Argument?1(argname, lineno, col_offset, annotationType, hasTypeAnnotation=False, has3107Annotation=False, hasTypeComment=False) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Function._maybeInjectClassArgument?5(funcObj) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Function._singleLineColonSeeker?5(line) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Function.colonSeeker?4(lines) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Function.fromNode?4(node, lines, **kwargs) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Function.getAnnotatedArguments?4() +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Function.getClassDecoratorType?4() +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Function.getFunctionType?4() +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Function.getMissedAnnotations?4() +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Function.hasDecorator?4(checkDecorators) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Function.isDynamicallyTyped?4() +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Function.isFullyAnnotated?4() +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Function.tryTypeComment?4(node) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.Function?1(name, lineno, col_offset, functionType=FunctionType.PUBLIC, isClassMethod=False, classDecoratorType=None, isReturnAnnotated=False, hasTypeComment=False, hasOnlyNoneReturns=True, isNested=False, decoratorList=None, args=None) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.FunctionVisitor.switchContext?4(node) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.FunctionVisitor.visit_AsyncFunctionDef?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.FunctionVisitor.visit_ClassDef?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.FunctionVisitor.visit_FunctionDef?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.FunctionVisitor?1(lines) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.ReturnVisitor.hasOnlyNoneReturns?4() +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.ReturnVisitor.switchContext?4(node) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.ReturnVisitor.visit_AsyncFunctionDef?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.ReturnVisitor.visit_FunctionDef?7 +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.ReturnVisitor.visit_Return?4(node) +eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.ReturnVisitor?1(parentNode) eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.translations._annotationsMessages?8 eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.translations._annotationsMessagesSampleArgs?8 eric6.Plugins.CheckerPlugins.CodeStyleChecker.AstUtilities.getValue?4(node)
--- a/eric6/APIs/Python3/eric6.bas Sat Apr 17 12:36:40 2021 +0200 +++ b/eric6/APIs/Python3/eric6.bas Sat Apr 17 12:37:41 2021 +0200 @@ -21,6 +21,7 @@ AddFoundFilesDialog QDialog Ui_AddFoundFilesDialog AddLanguageDialog QDialog Ui_AddLanguageDialog AddProjectDialog QDialog Ui_AddProjectDialog +AnnotationType Enum ApplicationDiagramBuilder UMLDiagramBuilder ApplicationPage ConfigurationPageBase Ui_ApplicationPage ArgumentsError RuntimeError @@ -69,6 +70,7 @@ ChromeImporter BookmarksImporter CircuitPythonDevice MicroPythonDevice Class ClbrBaseClasses.Class VisibilityMixin +ClassDecoratorType Enum ClassItem UMLItem ClassModel UMLModel ClbrBase _ClbrBase @@ -320,6 +322,7 @@ FtpDirLineParserError Exception FtpSyncHandler SyncHandler Function ClbrBaseClasses.Function VisibilityMixin +FunctionType Enum FunctionVisitor ast.NodeVisitor GenericMicroPythonDevice MicroPythonDevice Git VersionControl
--- a/eric6/Documentation/Help/source.qhp Sat Apr 17 12:36:40 2021 +0200 +++ b/eric6/Documentation/Help/source.qhp Sat Apr 17 12:37:41 2021 +0200 @@ -306,6 +306,9 @@ <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker" ref="index-eric6.Plugins.CheckerPlugins.CodeStyleChecker.html"> <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations" ref="index-eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.html"> <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html" /> + <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsCheckerDefaults" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsCheckerDefaults.html" /> + <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.html" /> + <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html" /> <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.translations" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.translations.html" /> </section> <section title="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Complexity" ref="index-eric6.Plugins.CheckerPlugins.CodeStyleChecker.Complexity.html"> @@ -1748,16 +1751,26 @@ <keyword name="AddProjectDialog.getData" id="AddProjectDialog.getData" ref="eric6.MultiProject.AddProjectDialog.html#AddProjectDialog.getData" /> <keyword name="AddProjectDialog.on_filenamePicker_textChanged" id="AddProjectDialog.on_filenamePicker_textChanged" ref="eric6.MultiProject.AddProjectDialog.html#AddProjectDialog.on_filenamePicker_textChanged" /> <keyword name="AddProjectDialog.on_nameEdit_textChanged" id="AddProjectDialog.on_nameEdit_textChanged" ref="eric6.MultiProject.AddProjectDialog.html#AddProjectDialog.on_nameEdit_textChanged" /> + <keyword name="AnnotationType" id="AnnotationType" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.html#AnnotationType" /> <keyword name="Annotations (Package)" id="Annotations (Package)" ref="index-eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.html" /> <keyword name="AnnotationsChecker" id="AnnotationsChecker" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker" /> <keyword name="AnnotationsChecker (Constructor)" id="AnnotationsChecker (Constructor)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker.__init__" /> <keyword name="AnnotationsChecker (Module)" id="AnnotationsChecker (Module)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html" /> + <keyword name="AnnotationsChecker.__argumentErrorClassifier" id="AnnotationsChecker.__argumentErrorClassifier" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker.__argumentErrorClassifier" /> <keyword name="AnnotationsChecker.__checkAnnotationComplexity" id="AnnotationsChecker.__checkAnnotationComplexity" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker.__checkAnnotationComplexity" /> <keyword name="AnnotationsChecker.__checkAnnotationsCoverage" id="AnnotationsChecker.__checkAnnotationsCoverage" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker.__checkAnnotationsCoverage" /> <keyword name="AnnotationsChecker.__checkFunctionAnnotations" id="AnnotationsChecker.__checkFunctionAnnotations" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker.__checkFunctionAnnotations" /> + <keyword name="AnnotationsChecker.__classifyError" id="AnnotationsChecker.__classifyError" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker.__classifyError" /> <keyword name="AnnotationsChecker.__error" id="AnnotationsChecker.__error" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker.__error" /> + <keyword name="AnnotationsChecker.__getAnnotationComplexity" id="AnnotationsChecker.__getAnnotationComplexity" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker.__getAnnotationComplexity" /> + <keyword name="AnnotationsChecker.__getAnnotationLength" id="AnnotationsChecker.__getAnnotationLength" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker.__getAnnotationLength" /> + <keyword name="AnnotationsChecker.__hasTypeAnnotations" id="AnnotationsChecker.__hasTypeAnnotations" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker.__hasTypeAnnotations" /> <keyword name="AnnotationsChecker.__ignoreCode" id="AnnotationsChecker.__ignoreCode" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker.__ignoreCode" /> + <keyword name="AnnotationsChecker.__returnErrorClassifier" id="AnnotationsChecker.__returnErrorClassifier" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker.__returnErrorClassifier" /> <keyword name="AnnotationsChecker.run" id="AnnotationsChecker.run" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#AnnotationsChecker.run" /> + <keyword name="AnnotationsCheckerDefaults (Module)" id="AnnotationsCheckerDefaults (Module)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsCheckerDefaults.html" /> + <keyword name="AnnotationsEnums (Module)" id="AnnotationsEnums (Module)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.html" /> + <keyword name="AnnotationsFunctionVisitor (Module)" id="AnnotationsFunctionVisitor (Module)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html" /> <keyword name="AppInfo (Module)" id="AppInfo (Module)" ref="eric6.Globals.AppInfo.html" /> <keyword name="ApplicationDiagramBuilder" id="ApplicationDiagramBuilder" ref="eric6.Graphics.ApplicationDiagramBuilder.html#ApplicationDiagramBuilder" /> <keyword name="ApplicationDiagramBuilder (Constructor)" id="ApplicationDiagramBuilder (Constructor)" ref="eric6.Graphics.ApplicationDiagramBuilder.html#ApplicationDiagramBuilder.__init__" /> @@ -1772,6 +1785,9 @@ <keyword name="ApplicationPage (Constructor)" id="ApplicationPage (Constructor)" ref="eric6.Preferences.ConfigurationPages.ApplicationPage.html#ApplicationPage.__init__" /> <keyword name="ApplicationPage (Module)" id="ApplicationPage (Module)" ref="eric6.Preferences.ConfigurationPages.ApplicationPage.html" /> <keyword name="ApplicationPage.save" id="ApplicationPage.save" ref="eric6.Preferences.ConfigurationPages.ApplicationPage.html#ApplicationPage.save" /> + <keyword name="Argument" id="Argument" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Argument" /> + <keyword name="Argument (Constructor)" id="Argument (Constructor)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Argument.__init__" /> + <keyword name="Argument.fromNode" id="Argument.fromNode" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Argument.fromNode" /> <keyword name="ArgumentsError" id="ArgumentsError" ref="eric6.E5Gui.E5Action.html#ArgumentsError" /> <keyword name="ArgumentsError (Constructor)" id="ArgumentsError (Constructor)" ref="eric6.E5Gui.E5Action.html#ArgumentsError.__init__" /> <keyword name="ArgumentsError.__repr__" id="ArgumentsError.__repr__" ref="eric6.E5Gui.E5Action.html#ArgumentsError.__repr__" /> @@ -2487,6 +2503,7 @@ <keyword name="Class.getMethod" id="Class.getMethod" ref="eric6.Utilities.ModuleParser.html#Class.getMethod" /> <keyword name="Class.setEndLine" id="Class.setEndLine" ref="eric6.Utilities.ModuleParser.html#Class.setEndLine" /> <keyword name="ClassBrowsers (Package)" id="ClassBrowsers (Package)" ref="index-eric6.Utilities.ClassBrowsers.html" /> + <keyword name="ClassDecoratorType" id="ClassDecoratorType" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.html#ClassDecoratorType" /> <keyword name="ClassItem" id="ClassItem" ref="eric6.Graphics.ClassItem.html#ClassItem" /> <keyword name="ClassItem (Constructor)" id="ClassItem (Constructor)" ref="eric6.Graphics.ClassItem.html#ClassItem.__init__" /> <keyword name="ClassItem (Module)" id="ClassItem (Module)" ref="eric6.Graphics.ClassItem.html" /> @@ -5958,30 +5975,41 @@ <keyword name="FtpSyncHandler.syncSpeedDial" id="FtpSyncHandler.syncSpeedDial" ref="eric6.WebBrowser.Sync.FtpSyncHandler.html#FtpSyncHandler.syncSpeedDial" /> <keyword name="FtpSyncHandler.syncUserAgents" id="FtpSyncHandler.syncUserAgents" ref="eric6.WebBrowser.Sync.FtpSyncHandler.html#FtpSyncHandler.syncUserAgents" /> <keyword name="FtpUtilities (Module)" id="FtpUtilities (Module)" ref="eric6.Utilities.FtpUtilities.html" /> + <keyword name="Function" id="Function" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function" /> <keyword name="Function" id="Function" ref="eric6.Utilities.ClassBrowsers.ClbrBaseClasses.html#Function" /> <keyword name="Function" id="Function" ref="eric6.Utilities.ClassBrowsers.idlclbr.html#Function" /> <keyword name="Function" id="Function" ref="eric6.Utilities.ClassBrowsers.jsclbr.html#Function" /> <keyword name="Function" id="Function" ref="eric6.Utilities.ClassBrowsers.pyclbr.html#Function" /> <keyword name="Function" id="Function" ref="eric6.Utilities.ClassBrowsers.rbclbr.html#Function" /> <keyword name="Function" id="Function" ref="eric6.Utilities.ModuleParser.html#Function" /> + <keyword name="Function (Constructor)" id="Function (Constructor)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function.__init__" /> <keyword name="Function (Constructor)" id="Function (Constructor)" ref="eric6.Utilities.ClassBrowsers.ClbrBaseClasses.html#Function.__init__" /> <keyword name="Function (Constructor)" id="Function (Constructor)" ref="eric6.Utilities.ClassBrowsers.idlclbr.html#Function.__init__" /> <keyword name="Function (Constructor)" id="Function (Constructor)" ref="eric6.Utilities.ClassBrowsers.jsclbr.html#Function.__init__" /> <keyword name="Function (Constructor)" id="Function (Constructor)" ref="eric6.Utilities.ClassBrowsers.pyclbr.html#Function.__init__" /> <keyword name="Function (Constructor)" id="Function (Constructor)" ref="eric6.Utilities.ClassBrowsers.rbclbr.html#Function.__init__" /> <keyword name="Function (Constructor)" id="Function (Constructor)" ref="eric6.Utilities.ModuleParser.html#Function.__init__" /> + <keyword name="Function.__decoratorChecker" id="Function.__decoratorChecker" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function.__decoratorChecker" /> + <keyword name="Function._maybeInjectClassArgument" id="Function._maybeInjectClassArgument" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function._maybeInjectClassArgument" /> + <keyword name="Function._singleLineColonSeeker" id="Function._singleLineColonSeeker" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function._singleLineColonSeeker" /> <keyword name="Function.addDescription" id="Function.addDescription" ref="eric6.Utilities.ModuleParser.html#Function.addDescription" /> + <keyword name="Function.colonSeeker" id="Function.colonSeeker" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function.colonSeeker" /> + <keyword name="Function.fromNode" id="Function.fromNode" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function.fromNode" /> + <keyword name="Function.getAnnotatedArguments" id="Function.getAnnotatedArguments" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function.getAnnotatedArguments" /> + <keyword name="Function.getClassDecoratorType" id="Function.getClassDecoratorType" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function.getClassDecoratorType" /> + <keyword name="Function.getFunctionType" id="Function.getFunctionType" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function.getFunctionType" /> + <keyword name="Function.getMissedAnnotations" id="Function.getMissedAnnotations" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function.getMissedAnnotations" /> + <keyword name="Function.hasDecorator" id="Function.hasDecorator" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function.hasDecorator" /> + <keyword name="Function.isDynamicallyTyped" id="Function.isDynamicallyTyped" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function.isDynamicallyTyped" /> + <keyword name="Function.isFullyAnnotated" id="Function.isFullyAnnotated" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function.isFullyAnnotated" /> <keyword name="Function.setEndLine" id="Function.setEndLine" ref="eric6.Utilities.ModuleParser.html#Function.setEndLine" /> + <keyword name="Function.tryTypeComment" id="Function.tryTypeComment" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#Function.tryTypeComment" /> <keyword name="FunctionInfo" id="FunctionInfo" ref="eric6.QScintilla.DocstringGenerator.BaseDocstringGenerator.html#FunctionInfo" /> <keyword name="FunctionInfo (Constructor)" id="FunctionInfo (Constructor)" ref="eric6.QScintilla.DocstringGenerator.BaseDocstringGenerator.html#FunctionInfo.__init__" /> - <keyword name="FunctionVisitor" id="FunctionVisitor" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#FunctionVisitor" /> - <keyword name="FunctionVisitor (Constructor)" id="FunctionVisitor (Constructor)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#FunctionVisitor.__init__" /> - <keyword name="FunctionVisitor.__checkFunctionNode" id="FunctionVisitor.__checkFunctionNode" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#FunctionVisitor.__checkFunctionNode" /> - <keyword name="FunctionVisitor.__classifyArgumentError" id="FunctionVisitor.__classifyArgumentError" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#FunctionVisitor.__classifyArgumentError" /> - <keyword name="FunctionVisitor.__classifyReturnError" id="FunctionVisitor.__classifyReturnError" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#FunctionVisitor.__classifyReturnError" /> - <keyword name="FunctionVisitor.visit_AsyncFunctionDef" id="FunctionVisitor.visit_AsyncFunctionDef" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#FunctionVisitor.visit_AsyncFunctionDef" /> - <keyword name="FunctionVisitor.visit_ClassDef" id="FunctionVisitor.visit_ClassDef" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#FunctionVisitor.visit_ClassDef" /> - <keyword name="FunctionVisitor.visit_FunctionDef" id="FunctionVisitor.visit_FunctionDef" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#FunctionVisitor.visit_FunctionDef" /> + <keyword name="FunctionType" id="FunctionType" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.html#FunctionType" /> + <keyword name="FunctionVisitor" id="FunctionVisitor" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#FunctionVisitor" /> + <keyword name="FunctionVisitor (Constructor)" id="FunctionVisitor (Constructor)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#FunctionVisitor.__init__" /> + <keyword name="FunctionVisitor.switchContext" id="FunctionVisitor.switchContext" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#FunctionVisitor.switchContext" /> <keyword name="GenericMicroPythonDevice" id="GenericMicroPythonDevice" ref="eric6.MicroPython.GenericMicroPythonDevices.html#GenericMicroPythonDevice" /> <keyword name="GenericMicroPythonDevice (Constructor)" id="GenericMicroPythonDevice (Constructor)" ref="eric6.MicroPython.GenericMicroPythonDevices.html#GenericMicroPythonDevice.__init__" /> <keyword name="GenericMicroPythonDevice.__deviceVolumeMounted" id="GenericMicroPythonDevice.__deviceVolumeMounted" ref="eric6.MicroPython.GenericMicroPythonDevices.html#GenericMicroPythonDevice.__deviceVolumeMounted" /> @@ -12675,7 +12703,9 @@ <keyword name="RestructuredTextProvider.line" id="RestructuredTextProvider.line" ref="eric6.QScintilla.MarkupProviders.RestructuredTextProvider.html#RestructuredTextProvider.line" /> <keyword name="RestructuredTextProvider.numberedList" id="RestructuredTextProvider.numberedList" ref="eric6.QScintilla.MarkupProviders.RestructuredTextProvider.html#RestructuredTextProvider.numberedList" /> <keyword name="RestructuredTextProvider.quote" id="RestructuredTextProvider.quote" ref="eric6.QScintilla.MarkupProviders.RestructuredTextProvider.html#RestructuredTextProvider.quote" /> + <keyword name="ReturnVisitor" id="ReturnVisitor" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#ReturnVisitor" /> <keyword name="ReturnVisitor" id="ReturnVisitor" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor" /> + <keyword name="ReturnVisitor (Constructor)" id="ReturnVisitor (Constructor)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#ReturnVisitor.__init__" /> <keyword name="ReturnVisitor (Constructor)" id="ReturnVisitor (Constructor)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.__init__" /> <keyword name="ReturnVisitor.__checkFunction" id="ReturnVisitor.__checkFunction" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.__checkFunction" /> <keyword name="ReturnVisitor.__checkImplicitReturn" id="ReturnVisitor.__checkImplicitReturn" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.__checkImplicitReturn" /> @@ -12690,14 +12720,17 @@ <keyword name="ReturnVisitor.__visitLoop" id="ReturnVisitor.__visitLoop" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.__visitLoop" /> <keyword name="ReturnVisitor.__visitWithStack" id="ReturnVisitor.__visitWithStack" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.__visitWithStack" /> <keyword name="ReturnVisitor.assigns" id="ReturnVisitor.assigns" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.assigns" /> + <keyword name="ReturnVisitor.hasOnlyNoneReturns" id="ReturnVisitor.hasOnlyNoneReturns" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#ReturnVisitor.hasOnlyNoneReturns" /> <keyword name="ReturnVisitor.refs" id="ReturnVisitor.refs" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.refs" /> <keyword name="ReturnVisitor.returns" id="ReturnVisitor.returns" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.returns" /> + <keyword name="ReturnVisitor.switchContext" id="ReturnVisitor.switchContext" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#ReturnVisitor.switchContext" /> <keyword name="ReturnVisitor.visit_Assign" id="ReturnVisitor.visit_Assign" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.visit_Assign" /> <keyword name="ReturnVisitor.visit_AsyncFor" id="ReturnVisitor.visit_AsyncFor" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.visit_AsyncFor" /> <keyword name="ReturnVisitor.visit_AsyncFunctionDef" id="ReturnVisitor.visit_AsyncFunctionDef" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.visit_AsyncFunctionDef" /> <keyword name="ReturnVisitor.visit_For" id="ReturnVisitor.visit_For" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.visit_For" /> <keyword name="ReturnVisitor.visit_FunctionDef" id="ReturnVisitor.visit_FunctionDef" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.visit_FunctionDef" /> <keyword name="ReturnVisitor.visit_Name" id="ReturnVisitor.visit_Name" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.visit_Name" /> + <keyword name="ReturnVisitor.visit_Return" id="ReturnVisitor.visit_Return" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html#ReturnVisitor.visit_Return" /> <keyword name="ReturnVisitor.visit_Return" id="ReturnVisitor.visit_Return" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.visit_Return" /> <keyword name="ReturnVisitor.visit_While" id="ReturnVisitor.visit_While" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html#ReturnVisitor.visit_While" /> <keyword name="SafariImporter" id="SafariImporter" ref="eric6.WebBrowser.Bookmarks.BookmarksImporters.SafariImporter.html#SafariImporter" /> @@ -17819,7 +17852,6 @@ <keyword name="generateVersionInfo" id="generateVersionInfo" ref="eric6.Utilities.__init__.html#generateVersionInfo" /> <keyword name="getAllImages" id="getAllImages" ref="eric6.WebBrowser.Tools.Scripts.html#getAllImages" /> <keyword name="getAllMetaAttributes" id="getAllMetaAttributes" ref="eric6.WebBrowser.Tools.Scripts.html#getAllMetaAttributes" /> - <keyword name="getAnnotationComplexity" id="getAnnotationComplexity" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#getAnnotationComplexity" /> <keyword name="getAttrQualName" id="getAttrQualName" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Security.SecurityUtils.html#getAttrQualName" /> <keyword name="getBasicHelper" id="getBasicHelper" ref="eric6.VCS.__init__.html#getBasicHelper" /> <keyword name="getCallName" id="getCallName" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Security.SecurityUtils.html#getCallName" /> @@ -18026,7 +18058,6 @@ <keyword name="handleSingleApplication" id="handleSingleApplication" ref="eric6.eric6.html#handleSingleApplication" /> <keyword name="hasEnvironmentEntry" id="hasEnvironmentEntry" ref="eric6.Utilities.__init__.html#hasEnvironmentEntry" /> <keyword name="hasShell" id="hasShell" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Security.Checks.injectionShell.html#hasShell" /> - <keyword name="hasTypeAnnotations" id="hasTypeAnnotations" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html#hasTypeAnnotations" /> <keyword name="hashPassword" id="hashPassword" ref="eric6.Utilities.crypto.py3PBKDF2.html#hashPassword" /> <keyword name="hashPasswordTuple" id="hashPasswordTuple" ref="eric6.Utilities.crypto.py3PBKDF2.html#hashPasswordTuple" /> <keyword name="hg (Module)" id="hg (Module)" ref="eric6.Plugins.VcsPlugins.vcsMercurial.hg.html" /> @@ -18763,6 +18794,9 @@ <file>eric6.PluginManager.PluginUninstallDialog.html</file> <file>eric6.Plugins.AboutPlugin.AboutDialog.html</file> <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html</file> + <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsCheckerDefaults.html</file> + <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.html</file> + <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html</file> <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.translations.html</file> <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.AstUtilities.html</file> <file>eric6.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleAddBuiltinIgnoreDialog.html</file>
--- a/eric6/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html Sat Apr 17 12:36:40 2021 +0200 +++ b/eric6/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsChecker.html Sat Apr 17 12:37:41 2021 +0200 @@ -38,23 +38,11 @@ <td><a href="#AnnotationsChecker">AnnotationsChecker</a></td> <td>Class implementing a checker for function type annotations.</td> </tr> -<tr> -<td><a href="#FunctionVisitor">FunctionVisitor</a></td> -<td>Class implementing a node visitor to check function annotations.</td> -</tr> </table> <h3>Functions</h3> <table> - -<tr> -<td><a href="#getAnnotationComplexity">getAnnotationComplexity</a></td> -<td>Function to determine the annotation complexity.</td> -</tr> -<tr> -<td><a href="#hasTypeAnnotations">hasTypeAnnotations</a></td> -<td>Function to check for type annotations.</td> -</tr> +<tr><td>None</td></tr> </table> <hr /> <hr /> @@ -85,6 +73,10 @@ <td>Constructor</td> </tr> <tr> +<td><a href="#AnnotationsChecker.__argumentErrorClassifier">__argumentErrorClassifier</a></td> +<td>Private method to classify an argument type annotation issue.</td> +</tr> +<tr> <td><a href="#AnnotationsChecker.__checkAnnotationComplexity">__checkAnnotationComplexity</a></td> <td>Private method to check the type annotation complexity.</td> </tr> @@ -97,14 +89,34 @@ <td>Private method to check for function annotation issues.</td> </tr> <tr> +<td><a href="#AnnotationsChecker.__classifyError">__classifyError</a></td> +<td>Private method to classify the missing type annotation based on the Function & Argument metadata.</td> +</tr> +<tr> <td><a href="#AnnotationsChecker.__error">__error</a></td> <td>Private method to record an issue.</td> </tr> <tr> +<td><a href="#AnnotationsChecker.__getAnnotationComplexity">__getAnnotationComplexity</a></td> +<td>Private method to determine the annotation complexity.</td> +</tr> +<tr> +<td><a href="#AnnotationsChecker.__getAnnotationLength">__getAnnotationLength</a></td> +<td>Private method to determine the annotation length.</td> +</tr> +<tr> +<td><a href="#AnnotationsChecker.__hasTypeAnnotations">__hasTypeAnnotations</a></td> +<td>Private method to check for type annotations.</td> +</tr> +<tr> <td><a href="#AnnotationsChecker.__ignoreCode">__ignoreCode</a></td> <td>Private method to check if the message code should be ignored.</td> </tr> <tr> +<td><a href="#AnnotationsChecker.__returnErrorClassifier">__returnErrorClassifier</a></td> +<td>Private method to classify a return type annotation issue.</td> +</tr> +<tr> <td><a href="#AnnotationsChecker.run">run</a></td> <td>Public method to check the given source against annotation issues.</td> </tr> @@ -157,6 +169,44 @@ dictionary of arguments for the annotation checks </dd> </dl> +<a NAME="AnnotationsChecker.__argumentErrorClassifier" ID="AnnotationsChecker.__argumentErrorClassifier"></a> +<h4>AnnotationsChecker.__argumentErrorClassifier</h4> +<b>__argumentErrorClassifier</b>(<i>isClassMethod, isFirstArg, classDecoratorType, annotationType</i>) + +<p> + Private method to classify an argument type annotation issue. +</p> +<dl> + +<dt><i>isClassMethod</i> (bool)</dt> +<dd> +flag indicating a classmethod type function +</dd> +<dt><i>isFirstArg</i> (bool)</dt> +<dd> +flag indicating the first argument +</dd> +<dt><i>classDecoratorType</i> (enums.ClassDecoratorType)</dt> +<dd> +type of class decorator +</dd> +<dt><i>annotationType</i> (AnnotationType)</dt> +<dd> +type of annotation +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +error code +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> <a NAME="AnnotationsChecker.__checkAnnotationComplexity" ID="AnnotationsChecker.__checkAnnotationComplexity"></a> <h4>AnnotationsChecker.__checkAnnotationComplexity</h4> <b>__checkAnnotationComplexity</b>(<i></i>) @@ -178,6 +228,34 @@ <p> Private method to check for function annotation issues. </p> +<a NAME="AnnotationsChecker.__classifyError" ID="AnnotationsChecker.__classifyError"></a> +<h4>AnnotationsChecker.__classifyError</h4> +<b>__classifyError</b>(<i>function, arg</i>) + +<p> + Private method to classify the missing type annotation based on the + Function & Argument metadata. +</p> +<p> + For the currently defined rules & program flow, the assumption can be + made that an argument passed to this method will match a linting error, + and will only match a single linting error +</p> +<p> + This function provides an initial classificaton, then passes relevant + attributes to cached helper function(s). +</p> +<dl> + +<dt><i>function</i> (Function)</dt> +<dd> +reference to the Function object +</dd> +<dt><i>arg</i> (Argument)</dt> +<dd> +reference to the Argument object +</dd> +</dl> <a NAME="AnnotationsChecker.__error" ID="AnnotationsChecker.__error"></a> <h4>AnnotationsChecker.__error</h4> <b>__error</b>(<i>lineNumber, offset, code, *args</i>) @@ -204,6 +282,90 @@ arguments for the message </dd> </dl> +<a NAME="AnnotationsChecker.__getAnnotationComplexity" ID="AnnotationsChecker.__getAnnotationComplexity"></a> +<h4>AnnotationsChecker.__getAnnotationComplexity</h4> +<b>__getAnnotationComplexity</b>(<i>annotationNode, defaultComplexity=1</i>) + +<p> + Private method to determine the annotation complexity. +</p> +<dl> + +<dt><i>annotationNode</i> (ast.AST)</dt> +<dd> +reference to the node to determine the annotation + complexity for +</dd> +<dt><i>defaultComplexity</i> (int)</dt> +<dd> +default complexity value +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +annotation complexity +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> += int +</dd> +</dl> +<a NAME="AnnotationsChecker.__getAnnotationLength" ID="AnnotationsChecker.__getAnnotationLength"></a> +<h4>AnnotationsChecker.__getAnnotationLength</h4> +<b>__getAnnotationLength</b>(<i>annotationNode</i>) + +<p> + Private method to determine the annotation length. +</p> +<dl> + +<dt><i>annotationNode</i> (ast.AST)</dt> +<dd> +reference to the node to determine the annotation + length for +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +annotation length +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> += int +</dd> +</dl> +<a NAME="AnnotationsChecker.__hasTypeAnnotations" ID="AnnotationsChecker.__hasTypeAnnotations"></a> +<h4>AnnotationsChecker.__hasTypeAnnotations</h4> +<b>__hasTypeAnnotations</b>(<i>funcNode</i>) + +<p> + Private method to check for type annotations. +</p> +<dl> + +<dt><i>funcNode</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> +<dd> +reference to the function definition node to be checked +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +flag indicating the presence of type annotations +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl> <a NAME="AnnotationsChecker.__ignoreCode" ID="AnnotationsChecker.__ignoreCode"></a> <h4>AnnotationsChecker.__ignoreCode</h4> <b>__ignoreCode</b>(<i>code</i>) @@ -230,6 +392,40 @@ bool </dd> </dl> +<a NAME="AnnotationsChecker.__returnErrorClassifier" ID="AnnotationsChecker.__returnErrorClassifier"></a> +<h4>AnnotationsChecker.__returnErrorClassifier</h4> +<b>__returnErrorClassifier</b>(<i>isClassMethod, classDecoratorType, functionType</i>) + +<p> + Private method to classify a return type annotation issue. +</p> +<dl> + +<dt><i>isClassMethod</i> (bool)</dt> +<dd> +flag indicating a classmethod type function +</dd> +<dt><i>classDecoratorType</i> (ClassDecoratorType)</dt> +<dd> +type of class decorator +</dd> +<dt><i>functionType</i> (FunctionType)</dt> +<dd> +type of function +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +error code +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> <a NAME="AnnotationsChecker.run" ID="AnnotationsChecker.run"></a> <h4>AnnotationsChecker.run</h4> <b>run</b>(<i></i>) @@ -239,248 +435,4 @@ </p> <div align="right"><a href="#top">Up</a></div> <hr /> -<hr /> -<a NAME="FunctionVisitor" ID="FunctionVisitor"></a> -<h2>FunctionVisitor</h2> - -<p> - Class implementing a node visitor to check function annotations. -</p> -<p> - Note: this class is modelled after flake8-annotations checker. -</p> -<h3>Derived from</h3> -ast.NodeVisitor -<h3>Class Attributes</h3> - -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> - -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> - -<table> - -<tr> -<td><a href="#FunctionVisitor.__init__">FunctionVisitor</a></td> -<td>Constructor</td> -</tr> -<tr> -<td><a href="#FunctionVisitor.__checkFunctionNode">__checkFunctionNode</a></td> -<td>Private method to check an individual function definition node.</td> -</tr> -<tr> -<td><a href="#FunctionVisitor.__classifyArgumentError">__classifyArgumentError</a></td> -<td>Private method to classify and record an argument annotation issue.</td> -</tr> -<tr> -<td><a href="#FunctionVisitor.__classifyReturnError">__classifyReturnError</a></td> -<td>Private method to classify and record a return annotation issue.</td> -</tr> -<tr> -<td><a href="#FunctionVisitor.visit_AsyncFunctionDef">visit_AsyncFunctionDef</a></td> -<td>Public method to handle an async function or method definition.</td> -</tr> -<tr> -<td><a href="#FunctionVisitor.visit_ClassDef">visit_ClassDef</a></td> -<td>Public method to handle class definitions.</td> -</tr> -<tr> -<td><a href="#FunctionVisitor.visit_FunctionDef">visit_FunctionDef</a></td> -<td>Public method to handle a function or method definition.</td> -</tr> -</table> -<h3>Static Methods</h3> - -<table> -<tr><td>None</td></tr> -</table> - -<a NAME="FunctionVisitor.__init__" ID="FunctionVisitor.__init__"></a> -<h4>FunctionVisitor (Constructor)</h4> -<b>FunctionVisitor</b>(<i>sourceLines</i>) - -<p> - Constructor -</p> -<dl> - -<dt><i>sourceLines</i> (list of str)</dt> -<dd> -lines of source code -</dd> -</dl> -<a NAME="FunctionVisitor.__checkFunctionNode" ID="FunctionVisitor.__checkFunctionNode"></a> -<h4>FunctionVisitor.__checkFunctionNode</h4> -<b>__checkFunctionNode</b>(<i>node, classMethod=False</i>) - -<p> - Private method to check an individual function definition node. -</p> -<dl> - -<dt><i>node</i> (ast.FunctionDef or ast.AsyncFunctionDef)</dt> -<dd> -reference to the node to be processed -</dd> -<dt><i>classMethod</i> (bool)</dt> -<dd> -flag indicating a class method -</dd> -</dl> -<a NAME="FunctionVisitor.__classifyArgumentError" ID="FunctionVisitor.__classifyArgumentError"></a> -<h4>FunctionVisitor.__classifyArgumentError</h4> -<b>__classifyArgumentError</b>(<i>argNode, argType, methodType</i>) - -<p> - Private method to classify and record an argument annotation issue. -</p> -<dl> - -<dt><i>argNode</i> (ast.arguments)</dt> -<dd> -reference to the argument node -</dd> -<dt><i>argType</i> (str)</dt> -<dd> -type of the argument node -</dd> -<dt><i>methodType</i> (str)</dt> -<dd> -type of method/function the argument belongs to -</dd> -</dl> -<a NAME="FunctionVisitor.__classifyReturnError" ID="FunctionVisitor.__classifyReturnError"></a> -<h4>FunctionVisitor.__classifyReturnError</h4> -<b>__classifyReturnError</b>(<i>methodType, visibilityType, lineno, colOffset</i>) - -<p> - Private method to classify and record a return annotation issue. -</p> -<dl> - -<dt><i>methodType</i> (str)</dt> -<dd> -type of method/function the argument belongs to -</dd> -<dt><i>visibilityType</i> (str)</dt> -<dd> -visibility of the function -</dd> -<dt><i>lineno</i> (int)</dt> -<dd> -line number -</dd> -<dt><i>colOffset</i> (int)</dt> -<dd> -column number -</dd> -</dl> -<a NAME="FunctionVisitor.visit_AsyncFunctionDef" ID="FunctionVisitor.visit_AsyncFunctionDef"></a> -<h4>FunctionVisitor.visit_AsyncFunctionDef</h4> -<b>visit_AsyncFunctionDef</b>(<i>node</i>) - -<p> - Public method to handle an async function or method definition. -</p> -<dl> - -<dt><i>node</i> (ast.AsyncFunctionDef)</dt> -<dd> -reference to the node to be processed -</dd> -</dl> -<a NAME="FunctionVisitor.visit_ClassDef" ID="FunctionVisitor.visit_ClassDef"></a> -<h4>FunctionVisitor.visit_ClassDef</h4> -<b>visit_ClassDef</b>(<i>node</i>) - -<p> - Public method to handle class definitions. -</p> -<dl> - -<dt><i>node</i> (ast.ClassDef)</dt> -<dd> -reference to the node to be processed -</dd> -</dl> -<a NAME="FunctionVisitor.visit_FunctionDef" ID="FunctionVisitor.visit_FunctionDef"></a> -<h4>FunctionVisitor.visit_FunctionDef</h4> -<b>visit_FunctionDef</b>(<i>node</i>) - -<p> - Public method to handle a function or method definition. -</p> -<dl> - -<dt><i>node</i> (ast.FunctionDef)</dt> -<dd> -reference to the node to be processed -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -<hr /> -<a NAME="getAnnotationComplexity" ID="getAnnotationComplexity"></a> -<h2>getAnnotationComplexity</h2> -<b>getAnnotationComplexity</b>(<i>annotationNode</i>) - -<p> - Function to determine the annotation complexity. -</p> -<dl> - -<dt><i>annotationNode</i> (ast.AST)</dt> -<dd> -reference to the node to determine the annotation - complexity for -</dd> -</dl> -<dl> -<dt>Return:</dt> -<dd> -annotation complexity -</dd> -</dl> -<dl> -<dt>Return Type:</dt> -<dd> -= int -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -<hr /> -<a NAME="hasTypeAnnotations" ID="hasTypeAnnotations"></a> -<h2>hasTypeAnnotations</h2> -<b>hasTypeAnnotations</b>(<i>funcNode</i>) - -<p> - Function to check for type annotations. -</p> -<dl> - -<dt><i>funcNode</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> -<dd> -reference to the function definition node to be checked -</dd> -</dl> -<dl> -<dt>Return:</dt> -<dd> -flag indicating the presence of type annotations -</dd> -</dl> -<dl> -<dt>Return Type:</dt> -<dd> -bool -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> </body></html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/eric6/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsCheckerDefaults.html Sat Apr 17 12:37:41 2021 +0200 @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html><head> +<title>eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsCheckerDefaults</title> +<meta charset="UTF-8"> +<style> +body { + background: #EDECE6; + margin: 0em 1em 10em 1em; + color: black; +} + +h1 { color: white; background: #85774A; } +h2 { color: white; background: #85774A; } +h3 { color: white; background: #9D936E; } +h4 { color: white; background: #9D936E; } + +a { color: #BA6D36; } + +</style> +</head> +<body> +<a NAME="top" ID="top"></a> +<h1>eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsCheckerDefaults</h1> + +<p> +Module implementing complex defaults for the annotations checker. +</p> +<h3>Global Attributes</h3> + +<table> +<tr><td>AnnotationsCheckerDefaultArgs</td></tr> +</table> +<h3>Classes</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Functions</h3> + +<table> +<tr><td>None</td></tr> +</table> +<hr /> +</body></html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/eric6/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.html Sat Apr 17 12:37:41 2021 +0200 @@ -0,0 +1,152 @@ +<!DOCTYPE html> +<html><head> +<title>eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums</title> +<meta charset="UTF-8"> +<style> +body { + background: #EDECE6; + margin: 0em 1em 10em 1em; + color: black; +} + +h1 { color: white; background: #85774A; } +h2 { color: white; background: #85774A; } +h3 { color: white; background: #9D936E; } +h4 { color: white; background: #9D936E; } + +a { color: #BA6D36; } + +</style> +</head> +<body> +<a NAME="top" ID="top"></a> +<h1>eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums</h1> + +<p> +Module implementing some enums for function type annotations. +</p> +<h3>Global Attributes</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Classes</h3> + +<table> + +<tr> +<td><a href="#AnnotationType">AnnotationType</a></td> +<td>Class representing the kind of missing type annotation.</td> +</tr> +<tr> +<td><a href="#ClassDecoratorType">ClassDecoratorType</a></td> +<td>Class representing the various class method decorators.</td> +</tr> +<tr> +<td><a href="#FunctionType">FunctionType</a></td> +<td>Class representing the various function types.</td> +</tr> +</table> +<h3>Functions</h3> + +<table> +<tr><td>None</td></tr> +</table> +<hr /> +<hr /> +<a NAME="AnnotationType" ID="AnnotationType"></a> +<h2>AnnotationType</h2> + +<p> + Class representing the kind of missing type annotation. +</p> +<h3>Derived from</h3> +Enum +<h3>Class Attributes</h3> + +<table> +<tr><td>ARGS</td></tr><tr><td>KWARG</td></tr><tr><td>KWONLYARGS</td></tr><tr><td>POSONLYARGS</td></tr><tr><td>RETURN</td></tr><tr><td>VARARG</td></tr> +</table> +<h3>Class Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="ClassDecoratorType" ID="ClassDecoratorType"></a> +<h2>ClassDecoratorType</h2> + +<p> + Class representing the various class method decorators. +</p> +<h3>Derived from</h3> +Enum +<h3>Class Attributes</h3> + +<table> +<tr><td>CLASSMETHOD</td></tr><tr><td>STATICMETHOD</td></tr> +</table> +<h3>Class Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="FunctionType" ID="FunctionType"></a> +<h2>FunctionType</h2> + +<p> + Class representing the various function types. +</p> +<h3>Derived from</h3> +Enum +<h3>Class Attributes</h3> + +<table> +<tr><td>PRIVATE</td></tr><tr><td>PROTECTED</td></tr><tr><td>PUBLIC</td></tr><tr><td>SPECIAL</td></tr> +</table> +<h3>Class Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/eric6/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html Sat Apr 17 12:37:41 2021 +0200 @@ -0,0 +1,969 @@ +<!DOCTYPE html> +<html><head> +<title>eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor</title> +<meta charset="UTF-8"> +<style> +body { + background: #EDECE6; + margin: 0em 1em 10em 1em; + color: black; +} + +h1 { color: white; background: #85774A; } +h2 { color: white; background: #85774A; } +h3 { color: white; background: #9D936E; } +h4 { color: white; background: #9D936E; } + +a { color: #BA6D36; } + +</style> +</head> +<body> +<a NAME="top" ID="top"></a> +<h1>eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor</h1> + +<p> +Module implementing a node visitor for function type annotations. +</p> +<h3>Global Attributes</h3> + +<table> +<tr><td>AST_ARG_TYPES</td></tr> +</table> +<h3>Classes</h3> + +<table> + +<tr> +<td><a href="#Argument">Argument</a></td> +<td>Class representing a function argument.</td> +</tr> +<tr> +<td><a href="#Function">Function</a></td> +<td>Class representing a function.</td> +</tr> +<tr> +<td><a href="#FunctionVisitor">FunctionVisitor</a></td> +<td>Class implementing a node visitor to check function annotations.</td> +</tr> +<tr> +<td><a href="#ReturnVisitor">ReturnVisitor</a></td> +<td>Class implementing a node visitor to check the return statements of a function node.</td> +</tr> +</table> +<h3>Functions</h3> + +<table> +<tr><td>None</td></tr> +</table> +<hr /> +<hr /> +<a NAME="Argument" ID="Argument"></a> +<h2>Argument</h2> + +<p> + Class representing a function argument. +</p> +<h3>Derived from</h3> +None +<h3>Class Attributes</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> + +<table> + +<tr> +<td><a href="#Argument.fromNode">fromNode</a></td> +<td>Class method to create an Argument object based on the given node.</td> +</tr> +</table> +<h3>Methods</h3> + +<table> + +<tr> +<td><a href="#Argument.__init__">Argument</a></td> +<td>Constructor</td> +</tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<a NAME="Argument.fromNode" ID="Argument.fromNode"></a> +<h4>Argument.fromNode (class method)</h4> +<b>fromNode</b>(<i>node, annotationTypeName</i>) + +<p> + Class method to create an Argument object based on the given node. +</p> +<dl> + +<dt><i>node</i> (ast.arguments)</dt> +<dd> +reference to the node to be converted +</dd> +<dt><i>annotationTypeName</i> (str)</dt> +<dd> +name of the annotation type +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +Argument object +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +Argument +</dd> +</dl> +<a NAME="Argument.__init__" ID="Argument.__init__"></a> +<h4>Argument (Constructor)</h4> +<b>Argument</b>(<i>argname, lineno, col_offset, annotationType, hasTypeAnnotation=False, has3107Annotation=False, hasTypeComment=False</i>) + +<p> + Constructor +</p> +<dl> + +<dt><i>argname</i> (str)</dt> +<dd> +name of the argument +</dd> +<dt><i>lineno</i> (int)</dt> +<dd> +line number +</dd> +<dt><i>col_offset</i> (int)</dt> +<dd> +column number +</dd> +<dt><i>annotationType</i> (AnnotationType)</dt> +<dd> +type of annotation +</dd> +<dt><i>hasTypeAnnotation</i> (bool (optional))</dt> +<dd> +flag indicating the presence of a type + annotation (defaults to False) +</dd> +<dt><i>has3107Annotation</i> (bool (optional))</dt> +<dd> +flag indicating the presence of a PEP 3107 + annotation (defaults to False) +</dd> +<dt><i>hasTypeComment</i> (bool (optional))</dt> +<dd> +flag indicating the presence of a type comment + (defaults to False) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="Function" ID="Function"></a> +<h2>Function</h2> + +<p> + Class representing a function. +</p> +<h3>Derived from</h3> +None +<h3>Class Attributes</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> + +<table> + +<tr> +<td><a href="#Function.fromNode">fromNode</a></td> +<td>Class method to create a Function object from ast.FunctionDef or ast.AsyncFunctionDef nodes.</td> +</tr> +</table> +<h3>Methods</h3> + +<table> + +<tr> +<td><a href="#Function.__init__">Function</a></td> +<td>Constructor</td> +</tr> +<tr> +<td><a href="#Function.__decoratorChecker">__decoratorChecker</a></td> +<td>Private method to check the provided decorator for a match against the provided set of check names.</td> +</tr> +<tr> +<td><a href="#Function.getAnnotatedArguments">getAnnotatedArguments</a></td> +<td>Public method to get list of arguments with type annotations.</td> +</tr> +<tr> +<td><a href="#Function.getMissedAnnotations">getMissedAnnotations</a></td> +<td>Public method to provide a list of arguments with missing type annotations.</td> +</tr> +<tr> +<td><a href="#Function.hasDecorator">hasDecorator</a></td> +<td>Public method to check whether the function node is decorated by any of the provided decorators.</td> +</tr> +<tr> +<td><a href="#Function.isDynamicallyTyped">isDynamicallyTyped</a></td> +<td>Public method to check, if a function definition is dynamically typed (i.e.</td> +</tr> +<tr> +<td><a href="#Function.isFullyAnnotated">isFullyAnnotated</a></td> +<td>Public method to check, if the function definition is fully type annotated.</td> +</tr> +</table> +<h3>Static Methods</h3> + +<table> + +<tr> +<td><a href="#Function._maybeInjectClassArgument">_maybeInjectClassArgument</a></td> +<td>Static method to inject `self` or `cls` args into a type comment to align with PEP 3107-style annotations.</td> +</tr> +<tr> +<td><a href="#Function._singleLineColonSeeker">_singleLineColonSeeker</a></td> +<td>Static method to find the line & column indices of a single line function definition.</td> +</tr> +<tr> +<td><a href="#Function.colonSeeker">colonSeeker</a></td> +<td>Static method to find the line & column indices of the function definition's closing colon.</td> +</tr> +<tr> +<td><a href="#Function.getClassDecoratorType">getClassDecoratorType</a></td> +<td>Static method to get the class method's decorator type from its function node.</td> +</tr> +<tr> +<td><a href="#Function.getFunctionType">getFunctionType</a></td> +<td>Static method to determine the function's FunctionType from its name.</td> +</tr> +<tr> +<td><a href="#Function.tryTypeComment">tryTypeComment</a></td> +<td>Static method to infer type hints from a function-level type comment.</td> +</tr> +</table> + +<a NAME="Function.fromNode" ID="Function.fromNode"></a> +<h4>Function.fromNode (class method)</h4> +<b>fromNode</b>(<i>node, lines, **kwargs</i>) + +<p> + Class method to create a Function object from ast.FunctionDef or + ast.AsyncFunctionDef nodes. +</p> +<p> + Accept the source code, as a list of strings, in order to get the + column where the function definition ends. +</p> +<p> + With exceptions, input kwargs are passed straight through to Function's + __init__. The following kwargs will be overridden: + * function_type + * class_decorator_type + * args +</p> +<dl> + +<dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> +<dd> +reference to the function definition node +</dd> +<dt><i>lines</i> (list of str)</dt> +<dd> +list of source code lines +</dd> +<dt><i>**kwargs=</i> (dict)</dt> +<dd> +keyword arguments +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +created Function object +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +Function +</dd> +</dl> +<a NAME="Function.__init__" ID="Function.__init__"></a> +<h4>Function (Constructor)</h4> +<b>Function</b>(<i>name, lineno, col_offset, functionType=FunctionType.PUBLIC, isClassMethod=False, classDecoratorType=None, isReturnAnnotated=False, hasTypeComment=False, hasOnlyNoneReturns=True, isNested=False, decoratorList=None, args=None</i>) + +<p> + Constructor +</p> +<dl> + +<dt><i>name</i> (str)</dt> +<dd> +name of the function +</dd> +<dt><i>lineno</i> (int)</dt> +<dd> +line number +</dd> +<dt><i>col_offset</i> (int)</dt> +<dd> +column number +</dd> +<dt><i>functionType</i> (FunctionType (optional))</dt> +<dd> +type of the function (defaults to + FunctionType.PUBLIC) +</dd> +<dt><i>isClassMethod</i> (bool (optional))</dt> +<dd> +flag indicating a class method (defaults to False) +</dd> +<dt><i>classDecoratorType</i> (ClassDecoratorType or None (optional))</dt> +<dd> +type of a function decorator + (defaults to None) +</dd> +<dt><i>isReturnAnnotated</i> (bool (optional))</dt> +<dd> +flag indicating the presence of a return + type annotation (defaults to False) +</dd> +<dt><i>hasTypeComment</i> (bool (optional))</dt> +<dd> +flag indicating the presence of a type comment + (defaults to False) +</dd> +<dt><i>hasOnlyNoneReturns</i> (bool (optional))</dt> +<dd> +flag indicating only None return values + (defaults to True) +</dd> +<dt><i>isNested</i> (bool (optional))</dt> +<dd> +flag indicating a nested function (defaults to False) +</dd> +<dt><i>decoratorList</i> (list of ast.Attribute, ast.Call or ast.Name (optional))</dt> +<dd> +list of decorator nodes (defaults to None) +</dd> +<dt><i>args</i> (list of Argument (optional))</dt> +<dd> +list of arguments (defaults to None) +</dd> +</dl> +<a NAME="Function.__decoratorChecker" ID="Function.__decoratorChecker"></a> +<h4>Function.__decoratorChecker</h4> +<b>__decoratorChecker</b>(<i>decorator, checkDecorators</i>) + +<p> + Private method to check the provided decorator for a match against the + provided set of check names. +</p> +<p> + Decorators are assumed to be of the following form: + * `a.name` or `a.name()` + * `name` or `name()` +</p> +<p> + Note: Deeper imports (e.g. `a.b.name`) are not explicitly supported. +</p> +<dl> + +<dt><i>decorator</i> (ast.Attribute, ast.Call or ast.Name)</dt> +<dd> +decorator node to check +</dd> +<dt><i>checkDecorators</i> (set of str)</dt> +<dd> +set of decorators to check against +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +flag indicating the presence of any decorators +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl> +<a NAME="Function.getAnnotatedArguments" ID="Function.getAnnotatedArguments"></a> +<h4>Function.getAnnotatedArguments</h4> +<b>getAnnotatedArguments</b>(<i></i>) + +<p> + Public method to get list of arguments with type annotations. +</p> +<dl> +<dt>Return:</dt> +<dd> +list of arguments with type annotations. +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +list of Argument +</dd> +</dl> +<a NAME="Function.getMissedAnnotations" ID="Function.getMissedAnnotations"></a> +<h4>Function.getMissedAnnotations</h4> +<b>getMissedAnnotations</b>(<i></i>) + +<p> + Public method to provide a list of arguments with missing type + annotations. +</p> +<dl> +<dt>Return:</dt> +<dd> +list of arguments with missing type annotations +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +list of Argument +</dd> +</dl> +<a NAME="Function.hasDecorator" ID="Function.hasDecorator"></a> +<h4>Function.hasDecorator</h4> +<b>hasDecorator</b>(<i>checkDecorators</i>) + +<p> + Public method to check whether the function node is decorated by any of + the provided decorators. +</p> +<p> + Decorator matching is done against the provided `checkDecorators` set. + Decorators are assumed to be either a module attribute (e.g. + `@typing.overload`) or name (e.g. `@overload`). For the case of a + module attribute, only the attribute is checked against + `overload_decorators`. +</p> +<p> + Note: Deeper decorator imports (e.g. `a.b.overload`) are not explicitly + supported. +</p> +<dl> + +<dt><i>checkDecorators</i> (set of str)</dt> +<dd> +set of decorators to check against +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +flag indicating the presence of any decorators +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl> +<a NAME="Function.isDynamicallyTyped" ID="Function.isDynamicallyTyped"></a> +<h4>Function.isDynamicallyTyped</h4> +<b>isDynamicallyTyped</b>(<i></i>) + +<p> + Public method to check, if a function definition is dynamically typed + (i.e. completely lacking hints). +</p> +<dl> +<dt>Return:</dt> +<dd> +flag indicating a dynamically typed function definition +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl> +<a NAME="Function.isFullyAnnotated" ID="Function.isFullyAnnotated"></a> +<h4>Function.isFullyAnnotated</h4> +<b>isFullyAnnotated</b>(<i></i>) + +<p> + Public method to check, if the function definition is fully type + annotated. +</p> +<p> + Note: self.args will always include an Argument object for return. +</p> +<dl> +<dt>Return:</dt> +<dd> +flag indicating a fully annotated function definition +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl> +<a NAME="Function._maybeInjectClassArgument" ID="Function._maybeInjectClassArgument"></a> +<h4>Function._maybeInjectClassArgument (static)</h4> +<b>_maybeInjectClassArgument</b>(<i>funcObj</i>) + +<p> + Static method to inject `self` or `cls` args into a type comment to + align with PEP 3107-style annotations. +</p> +<p> + Because PEP 484 does not describe a method to provide partial function- + level type comments, there is a potential for ambiguity in the context + of both class methods and classmethods when aligning type comments to + method arguments. +</p> +<p> + These two class methods, for example, should lint equivalently: +</p> +<p> + def bar(self, a): + # type: (int) -> int + ... +</p> +<p> + def bar(self, a: int) -> int + ... +</p> +<p> + When this example type comment is parsed by `ast` and then matched with + the method's arguments, it associates the `int` hint to `self` rather + than `a`, so a dummy hint needs to be provided in situations where + `self` or `class` are not hinted in the type comment in order to + achieve equivalent linting results to PEP-3107 style annotations. +</p> +<p> + A dummy `ast.Ellipses` constant is injected if the following criteria + are met: + 1. The function node is either a class method or classmethod + 2. The number of hinted args is at least 1 less than the number + of function args +</p> +<dl> + +<dt><i>hintTree</i> (ast.FunctionType)</dt> +<dd> +parsed type hint node +</dd> +<dt><i>funcObj</i> (Function)</dt> +<dd> +reference to the Function object +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +reference to the hint node +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +ast.FunctionType +</dd> +</dl> +<a NAME="Function._singleLineColonSeeker" ID="Function._singleLineColonSeeker"></a> +<h4>Function._singleLineColonSeeker (static)</h4> +<b>_singleLineColonSeeker</b>(<i>line</i>) + +<p> + Static method to find the line & column indices of a single line + function definition. +</p> +<dl> + +<dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> +<dd> +reference to the function definition node +</dd> +<dt><i>line</i> (str)</dt> +<dd> +source code line +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +line and column offset of the colon +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (int, int) +</dd> +</dl> +<a NAME="Function.colonSeeker" ID="Function.colonSeeker"></a> +<h4>Function.colonSeeker (static)</h4> +<b>colonSeeker</b>(<i>lines</i>) + +<p> + Static method to find the line & column indices of the function + definition's closing colon. +</p> +<dl> + +<dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> +<dd> +reference to the function definition node +</dd> +<dt><i>lines</i> (list of str)</dt> +<dd> +list of source code lines +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +line and column offset of the colon +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (int, int) +</dd> +</dl> +<a NAME="Function.getClassDecoratorType" ID="Function.getClassDecoratorType"></a> +<h4>Function.getClassDecoratorType (static)</h4> +<b>getClassDecoratorType</b>(<i></i>) + +<p> + Static method to get the class method's decorator type from its + function node. +</p> +<p> + Only @classmethod and @staticmethod decorators are identified; all + other decorators are ignored +</p> +<p> + If @classmethod or @staticmethod decorators are not present, this + function will return None. +</p> +<dl> + +<dt><i>functionNode</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> +<dd> +reference to the function definition node +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +class decorator type +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +ClassDecoratorType or None +</dd> +</dl> +<a NAME="Function.getFunctionType" ID="Function.getFunctionType"></a> +<h4>Function.getFunctionType (static)</h4> +<b>getFunctionType</b>(<i></i>) + +<p> + Static method to determine the function's FunctionType from its name. +</p> +<p> + MethodType is determined by the following priority: + 1. Special: function name prefixed & suffixed by "__" + 2. Private: function name prefixed by "__" + 3. Protected: function name prefixed by "_" + 4. Public: everything else +</p> +<dl> + +<dt><i>functionName</i> (str)</dt> +<dd> +function name to be checked +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +type of function +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +FunctionType +</dd> +</dl> +<a NAME="Function.tryTypeComment" ID="Function.tryTypeComment"></a> +<h4>Function.tryTypeComment (static)</h4> +<b>tryTypeComment</b>(<i>node</i>) + +<p> + Static method to infer type hints from a function-level type comment. +</p> +<p> + If a function is type commented it is assumed to have a return + annotation, otherwise Python will fail to parse the hint. +</p> +<dl> + +<dt><i>funcObj</i> (Function)</dt> +<dd> +reference to the Function object +</dd> +<dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> +<dd> +reference to the function definition node +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +reference to the modified Function object +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +Function +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="FunctionVisitor" ID="FunctionVisitor"></a> +<h2>FunctionVisitor</h2> + +<p> + Class implementing a node visitor to check function annotations. +</p> +<h3>Derived from</h3> +ast.NodeVisitor +<h3>Class Attributes</h3> + +<table> +<tr><td>visit_AsyncFunctionDef</td></tr><tr><td>visit_ClassDef</td></tr><tr><td>visit_FunctionDef</td></tr> +</table> +<h3>Class Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> + +<table> + +<tr> +<td><a href="#FunctionVisitor.__init__">FunctionVisitor</a></td> +<td>Constructor</td> +</tr> +<tr> +<td><a href="#FunctionVisitor.switchContext">switchContext</a></td> +<td>Public method implementing a context switcher as a generic function visitor in order to track function context.</td> +</tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<a NAME="FunctionVisitor.__init__" ID="FunctionVisitor.__init__"></a> +<h4>FunctionVisitor (Constructor)</h4> +<b>FunctionVisitor</b>(<i>lines</i>) + +<p> + Constructor +</p> +<dl> + +<dt><i>lines</i> (list of str)</dt> +<dd> +source code lines of the function +</dd> +</dl> +<a NAME="FunctionVisitor.switchContext" ID="FunctionVisitor.switchContext"></a> +<h4>FunctionVisitor.switchContext</h4> +<b>switchContext</b>(<i>node</i>) + +<p> + Public method implementing a context switcher as a generic function + visitor in order to track function context. +</p> +<p> + Without keeping track of context, it's challenging to reliably + differentiate class methods from "regular" functions, especially in the + case of nested classes. +</p> +<dl> + +<dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> +<dd> +reference to the function definition node to be analyzed +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="ReturnVisitor" ID="ReturnVisitor"></a> +<h2>ReturnVisitor</h2> + +<p> + Class implementing a node visitor to check the return statements of a + function node. +</p> +<p> + If the function node being visited has an explicit return statement of + anything other than `None`, the `instance.hasOnlyNoneReturns` flag will + be set to `False`. +</p> +<p> + If the function node being visited has no return statement, or contains + only return statement(s) that explicitly return `None`, the + `instance.hasOnlyNoneReturns` flag will be set to `True`. +</p> +<p> + Due to the generic visiting being done, we need to keep track of the + context in which a non-`None` return node is found. These functions are + added to a set that is checked to see whether nor not the parent node is + present. +</p> +<h3>Derived from</h3> +ast.NodeVisitor +<h3>Class Attributes</h3> + +<table> +<tr><td>visit_AsyncFunctionDef</td></tr><tr><td>visit_FunctionDef</td></tr> +</table> +<h3>Class Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> + +<table> + +<tr> +<td><a href="#ReturnVisitor.__init__">ReturnVisitor</a></td> +<td>Constructor</td> +</tr> +<tr> +<td><a href="#ReturnVisitor.hasOnlyNoneReturns">hasOnlyNoneReturns</a></td> +<td>Public method indicating, that the parent node isn't in the visited nodes that don't return `None`.</td> +</tr> +<tr> +<td><a href="#ReturnVisitor.switchContext">switchContext</a></td> +<td>Public method implementing a context switcher as a generic function visitor in order to track function context.</td> +</tr> +<tr> +<td><a href="#ReturnVisitor.visit_Return">visit_Return</a></td> +<td>Public method to check each Return node to see if it returns anything other than `None`.</td> +</tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<a NAME="ReturnVisitor.__init__" ID="ReturnVisitor.__init__"></a> +<h4>ReturnVisitor (Constructor)</h4> +<b>ReturnVisitor</b>(<i>parentNode</i>) + +<p> + Constructor +</p> +<dl> + +<dt><i>parentNode</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> +<dd> +reference to the function definition node to be + analyzed +</dd> +</dl> +<a NAME="ReturnVisitor.hasOnlyNoneReturns" ID="ReturnVisitor.hasOnlyNoneReturns"></a> +<h4>ReturnVisitor.hasOnlyNoneReturns</h4> +<b>hasOnlyNoneReturns</b>(<i></i>) + +<p> + Public method indicating, that the parent node isn't in the visited + nodes that don't return `None`. +</p> +<dl> +<dt>Return:</dt> +<dd> +flag indicating, that the parent node isn't in the visited + nodes that don't return `None` +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl> +<a NAME="ReturnVisitor.switchContext" ID="ReturnVisitor.switchContext"></a> +<h4>ReturnVisitor.switchContext</h4> +<b>switchContext</b>(<i>node</i>) + +<p> + Public method implementing a context switcher as a generic function + visitor in order to track function context. +</p> +<p> + Without keeping track of context, it's challenging to reliably + differentiate class methods from "regular" functions, especially in the + case of nested classes. +</p> +<dl> + +<dt><i>node</i> (ast.AsyncFunctionDef or ast.FunctionDef)</dt> +<dd> +reference to the function definition node to be analyzed +</dd> +</dl> +<a NAME="ReturnVisitor.visit_Return" ID="ReturnVisitor.visit_Return"></a> +<h4>ReturnVisitor.visit_Return</h4> +<b>visit_Return</b>(<i>node</i>) + +<p> + Public method to check each Return node to see if it returns anything + other than `None`. +</p> +<p> + If the node being visited returns anything other than `None`, its + parent context is added to the set of non-returning child nodes of + the parent node. +</p> +<dl> + +<dt><i>node</i> (ast.Return)</dt> +<dd> +reference to the AST Return node +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- a/eric6/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.Simplify.SimplifyNodeVisitor.html Sat Apr 17 12:36:40 2021 +0200 +++ b/eric6/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.Simplify.SimplifyNodeVisitor.html Sat Apr 17 12:37:41 2021 +0200 @@ -159,7 +159,7 @@ </tr> <tr> <td><a href="#SimplifyNodeVisitor.__check182">__check182</a></td> -<td>Private method to check for calls of type 'super(Foo, self)' that could be shortened to 'super()'.</td> +<td>Private method to check for calls of type 'super()' that could be shortened to 'super()'.</td> </tr> <tr> <td><a href="#SimplifyNodeVisitor.__check201">__check201</a></td> @@ -650,7 +650,7 @@ <b>__check182</b>(<i>node</i>) <p> - Private method to check for calls of type 'super(Foo, self)' that could + Private method to check for calls of type 'super()' that could be shortened to 'super()'. </p> <dl>
--- a/eric6/Documentation/Source/eric6.WebBrowser.WebBrowserPage.html Sat Apr 17 12:36:40 2021 +0200 +++ b/eric6/Documentation/Source/eric6.WebBrowser.WebBrowserPage.html Sat Apr 17 12:37:41 2021 +0200 @@ -369,8 +369,8 @@ <b>__registerProtocolHandlerRequested</b>(<i>request</i>) <p> - Private slot to handle the registration of a custom protocol - handler. + Private slot to handle the registration of a custom protocol + handler. </p> <dl>
--- a/eric6/Documentation/Source/index-eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.html Sat Apr 17 12:36:40 2021 +0200 +++ b/eric6/Documentation/Source/index-eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.html Sat Apr 17 12:37:41 2021 +0200 @@ -34,6 +34,18 @@ <td>Module implementing a checker for function type annotations.</td> </tr> <tr> +<td><a href="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsCheckerDefaults.html">AnnotationsCheckerDefaults</a></td> +<td>Module implementing complex defaults for the annotations checker.</td> +</tr> +<tr> +<td><a href="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsEnums.html">AnnotationsEnums</a></td> +<td>Module implementing some enums for function type annotations.</td> +</tr> +<tr> +<td><a href="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.AnnotationsFunctionVisitor.html">AnnotationsFunctionVisitor</a></td> +<td>Module implementing a node visitor for function type annotations.</td> +</tr> +<tr> <td><a href="eric6.Plugins.CheckerPlugins.CodeStyleChecker.Annotations.translations.html">translations</a></td> <td>Module implementing message translations for the code style plugin messages (code annotations part).</td> </tr>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsCheckerDefaults.py Sat Apr 17 12:37:41 2021 +0200 @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2021 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing complex defaults for the annotations checker. +""" + +AnnotationsCheckerDefaultArgs = { + # Annotations + "SuppressNoneReturning": False, + "SuppressDummyArgs": False, + "AllowUntypedDefs": False, + "AllowUntypedNested": False, + "MypyInitReturn": False, + "DispatchDecorators": ["singledispatch", "singledispatchmethod"], + "OverloadDecorators": ["overload"], + + # Annotation Coverage + "MinimumCoverage": 75, # % of type annotation coverage + + # Annotation Complexity + "MaximumComplexity": 3, + "MaximumLength": 7, +}