module documentation

Utility methods for docstring checking.

Class Docstring No class docstring; 0/1 instance variable, 1/2 class variable, 1/13 method documented
Class EpytextDocstring Epytext is similar to Sphinx.
Class GoogleDocstring No class docstring; 0/13 class variable, 1/12 method, 0/2 static method documented
Class NumpyDocstring No class docstring; 0/10 class variable, 1/1 method, 0/2 static method documented
Class SphinxDocstring No class docstring; 0/15 class variable, 1/8 method documented
Function docstringify Undocumented
Function get_setters_property Get the property node for the given setter node.
Function get_setters_property_name Get the name of the property that the given node is a setter for.
Function possible_exc_types Gets all the possible raised exception types for the given raise node.
Function returns_something Check if a return node returns a value other than None.
Function space_indentation The number of leading spaces in a string.
Constant DOCSTRING_TYPES A map of the name of the docstring type to its class.
Function _get_raise_target Undocumented
Function _split_multiple_exc_types Undocumented
def docstringify(docstring: nodes.Const|None, default_type: str = 'default') -> Docstring: (source)

Undocumented

def get_setters_property(node: nodes.FunctionDef) -> nodes.FunctionDef|None: (source)

Get the property node for the given setter node. :param node: The node to get the property for. :type node: nodes.FunctionDef :rtype: nodes.FunctionDef or None :returns: The node relating to the property of the given setter node, or None if one could not be found.

def get_setters_property_name(node: nodes.FunctionDef) -> str|None: (source)

Get the name of the property that the given node is a setter for. :param node: The node to get the property name for. :type node: str :rtype: str or None :returns: The name of the property that the node is a setter for, or None if one could not be found.

def possible_exc_types(node: nodes.NodeNG) -> set[nodes.ClassDef]: (source)

Gets all the possible raised exception types for the given raise node. .. note:: Caught exception types are ignored. :param node: The raise node to find exception types for. :returns: A list of exception types possibly raised by :param:`node`.

def returns_something(return_node: nodes.Return) -> bool: (source)

Check if a return node returns a value other than None. :param return_node: The return node to check. :type return_node: astroid.Return :rtype: bool :return: True if the return node returns a value other than None, False otherwise.

def space_indentation(s: str) -> int: (source)

The number of leading spaces in a string. :param str s: input string :rtype: int :return: number of leading spaces

DOCSTRING_TYPES = (source)

A map of the name of the docstring type to its class. :type: dict(str, type)

Value
{'sphinx': SphinxDocstring,
 'epytext': EpytextDocstring,
 'google': GoogleDocstring,
 'numpy': NumpyDocstring,
 'default': Docstring}
def _get_raise_target(node: nodes.NodeNG) -> (nodes.NodeNG|UninferableBase)|None: (source)

Undocumented

def _split_multiple_exc_types(target: str) -> list[str]: (source)

Undocumented