Skip to content

Commit

Permalink
docs: Add missing documentation for parameters of extension hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Aug 17, 2024
1 parent 8c630d5 commit 51c26ca
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/_griffe/extensions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def on_instance(
Parameters:
node: The currently visited node.
obj: The object instance.
agent: The analysis agent currently running.
**kwargs: For forward-compatibility.
"""

def on_members(self, *, node: ast.AST | ObjectNode, obj: Object, agent: Visitor | Inspector, **kwargs: Any) -> None:
Expand All @@ -90,13 +92,17 @@ def on_members(self, *, node: ast.AST | ObjectNode, obj: Object, agent: Visitor
Parameters:
node: The currently visited node.
obj: The object instance.
agent: The analysis agent currently running.
**kwargs: For forward-compatibility.
"""

def on_module_node(self, *, node: ast.AST | ObjectNode, agent: Visitor | Inspector, **kwargs: Any) -> None:
"""Run when visiting a new module node during static/dynamic analysis.
Parameters:
node: The currently visited node.
agent: The analysis agent currently running.
**kwargs: For forward-compatibility.
"""

def on_module_instance(
Expand All @@ -112,6 +118,8 @@ def on_module_instance(
Parameters:
node: The currently visited node.
mod: The module instance.
agent: The analysis agent currently running.
**kwargs: For forward-compatibility.
"""

def on_module_members(
Expand All @@ -127,13 +135,17 @@ def on_module_members(
Parameters:
node: The currently visited node.
mod: The module instance.
agent: The analysis agent currently running.
**kwargs: For forward-compatibility.
"""

def on_class_node(self, *, node: ast.AST | ObjectNode, agent: Visitor | Inspector, **kwargs: Any) -> None:
"""Run when visiting a new class node during static/dynamic analysis.
Parameters:
node: The currently visited node.
agent: The analysis agent currently running.
**kwargs: For forward-compatibility.
"""

def on_class_instance(
Expand All @@ -149,6 +161,8 @@ def on_class_instance(
Parameters:
node: The currently visited node.
cls: The class instance.
agent: The analysis agent currently running.
**kwargs: For forward-compatibility.
"""

def on_class_members(
Expand All @@ -164,13 +178,17 @@ def on_class_members(
Parameters:
node: The currently visited node.
cls: The class instance.
agent: The analysis agent currently running.
**kwargs: For forward-compatibility.
"""

def on_function_node(self, *, node: ast.AST | ObjectNode, agent: Visitor | Inspector, **kwargs: Any) -> None:
"""Run when visiting a new function node during static/dynamic analysis.
Parameters:
node: The currently visited node.
agent: The analysis agent currently running.
**kwargs: For forward-compatibility.
"""

def on_function_instance(
Expand All @@ -186,13 +204,17 @@ def on_function_instance(
Parameters:
node: The currently visited node.
func: The function instance.
agent: The analysis agent currently running.
**kwargs: For forward-compatibility.
"""

def on_attribute_node(self, *, node: ast.AST | ObjectNode, agent: Visitor | Inspector, **kwargs: Any) -> None:
"""Run when visiting a new attribute node during static/dynamic analysis.
Parameters:
node: The currently visited node.
agent: The analysis agent currently running.
**kwargs: For forward-compatibility.
"""

def on_attribute_instance(
Expand All @@ -208,13 +230,16 @@ def on_attribute_instance(
Parameters:
node: The currently visited node.
attr: The attribute instance.
agent: The analysis agent currently running.
**kwargs: For forward-compatibility.
"""

def on_package_loaded(self, *, pkg: Module, **kwargs: Any) -> None:
"""Run when a package has been completely loaded.
Parameters:
pkg: The package (Module) instance.
**kwargs: For forward-compatibility.
"""


Expand Down

0 comments on commit 51c26ca

Please sign in to comment.