src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Naming/NamingStyleChecker.py

branch
eric7
changeset 10437
2f70ca07f0af
parent 10069
435cc5875135
child 10439
21c28b0f9e41
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Naming/NamingStyleChecker.py	Fri Dec 22 17:24:07 2023 +0100
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Naming/NamingStyleChecker.py	Fri Dec 22 19:45:17 2023 +0100
@@ -50,8 +50,11 @@
         Constructor (according to 'extended' pycodestyle.py API)
 
         @param tree AST tree of the source file
-        @param filename name of the source file (string)
+        @type ast.AST
+        @param filename name of the source file
+        @type str
         @param options options as parsed by pycodestyle.StyleGuide
+        @type optparse.Option
         """
         self.__parents = collections.deque()
         self.__tree = tree
@@ -110,6 +113,7 @@
 
         @return tuple giving line number, offset within line, code and
             checker function
+        @rtype tuple of (int, int, str, function)
         """
         if self.__tree and self.__checkers:
             return self.__visitTree(self.__tree)
@@ -121,6 +125,7 @@
         Private method to scan the given AST tree.
 
         @param node AST tree node to scan
+        @type ast.AST
         @yield tuple giving line number, offset within line and error code
         @ytype tuple of (int, int, str)
         """
@@ -135,6 +140,7 @@
         Private method to inspect the given AST node.
 
         @param node AST tree node to inspect
+        @type ast.AST
         @yield tuple giving line number, offset within line and error code
         @ytype tuple of (int, int, str)
         """
@@ -155,6 +161,7 @@
         static methods.
 
         @param classNode AST tree node to tag
+        @type ast.ClassDef
         """
         # try to find all 'old style decorators'
         # like m = staticmethod(m)
@@ -198,6 +205,7 @@
         Private method amend a node with global definitions information.
 
         @param functionNode AST tree node to amend
+        @type ast.FunctionDef or ast.AsyncFunctionDef
         """
         globalNames = set()
         nodesToCheck = collections.deque(ast.iter_child_nodes(functionNode))
@@ -217,7 +225,9 @@
         Private method to get the argument names of a function node.
 
         @param node AST node to extract arguments names from
-        @return list of argument names (list of string)
+        @type ast.FunctionDef or ast.AsyncFunctionDef
+        @return list of argument names
+        @rtype list of str
         """
         posArgs = [arg.arg for arg in node.args.args]
         kwOnly = [arg.arg for arg in node.args.kwonlyargs]
@@ -228,9 +238,11 @@
         Private method to build the error information.
 
         @param node AST node to report an error for
-        @param code error code to report (string)
+        @type ast.AST
+        @param code error code to report
+        @type str
         @return tuple giving line number, offset within line and error code
-            (integer, integer, string)
+        @rtype tuple of (int, int, str)
         """
         if isinstance(node, ast.Module):
             lineno = 0
@@ -250,8 +262,10 @@
         """
         Private method to check, if the given name should be avoided.
 
-        @param name name to be checked (string)
-        @return flag indicating to avoid it (boolen)
+        @param name name to be checked
+        @type str
+        @return flag indicating to avoid it
+        @rtype bool
         """
         return name in ("l", "O", "I")
 
@@ -260,7 +274,9 @@
         Private class to check the given node for a name to be avoided (N831).
 
         @param node AST note to check
+        @type ast.Ast
         @param parents list of parent nodes
+        @type list of ast.AST
         @yield tuple giving line number, offset within line and error code
         @ytype tuple of (int, int, str)
         """
@@ -300,7 +316,7 @@
         @param name name of the class
         @type str
         @param parents list of parent nodes
-        @type ast.AST
+        @type list of ast.AST
         @return node containing the class definition
         @rtype ast.ClassDef
         """
@@ -318,7 +334,7 @@
         @param name name of the class
         @type str
         @param parents list of parent nodes
-        @type ast.AST
+        @type list of ast.AST
         @param names set of collected class names (defaults to None)
         @type set of str (optional)
         @return set of class names
@@ -347,7 +363,9 @@
         Classes for internal use have a leading underscore in addition.
 
         @param node AST note to check
+        @type ast.ClassDef
         @param parents list of parent nodes
+        @type list of ast.AST
         @yield tuple giving line number, offset within line and error code
         @ytype tuple of (int, int, str)
         """
@@ -372,7 +390,9 @@
         (e.g. threading.py), to retain backwards compatibility.
 
         @param node AST note to check
+        @type ast.FunctionDef or ast.AsynFunctionDef
         @param parents list of parent nodes
+        @type list of ast.AST
         @yield tuple giving line number, offset within line and error code
         @ytype tuple of (int, int, str)
         """
@@ -397,7 +417,9 @@
         first argument. A method should have 'self' as the first argument.
 
         @param node AST note to check
+        @type ast.FunctionDef or ast.AsynFunctionDef
         @param parents list of parent nodes
+        @type list of ast.AST
         @yield tuple giving line number, offset within line and error code
         @ytype tuple of (int, int, str)
         """
@@ -440,7 +462,9 @@
         Local variables in functions should be lowercase.
 
         @param node AST note to check
+        @type ast.AST
         @param parents list of parent nodes
+        @type list of ast.AST
         @yield tuple giving line number, offset within line and error code
         @ytype tuple of (int, int, str)
         """
@@ -601,8 +625,10 @@
 
         Module and package names should be lowercase.
 
-        @param node AST note to check
+        @param node AST node to check
+        @type ast.AST
         @param parents list of parent nodes
+        @type list of ast.AST
         @yield tuple giving line number, offset within line and error code
         @ytype tuple of (int, int, str)
         """
@@ -622,8 +648,10 @@
         Private method to check that imports don't change the
         naming convention (N811, N812, N813, N814, N815).
 
-        @param node AST note to check
+        @param node AST node to check
+        @type ast.Import
         @param parents list of parent nodes
+        @type list of ast.AST
         @yield tuple giving line number, offset within line and error code
         @ytype tuple of (int, int, str)
         """

eric ide

mercurial