class DocstringParameterChecker(BaseChecker): (source)
Checker for Sphinx, Google, or Numpy style docstrings. * Check that all function, method and constructor parameters are mentioned in the params and types part of the docstring. Constructor parameters can be documented in either the class docstring or ``__init__`` docstring, but not both. * Check that there are no naming inconsistencies between the signature and the documentation, i.e. also report documented parameters that are missing in the signature. This is important to find cases where parameters are renamed only in the code, not in the documentation. * Check that all explicitly raised exceptions in a function are documented in the function docstring. Caught exceptions are ignored. Activate this checker by adding the line:: load-plugins=pylint.extensions.docparams to the ``MAIN`` section of your ``.pylintrc``.
Method | check |
Check that all parameters are consistent with the parameters mentioned in the parameter documentation (e.g. the Sphinx tags 'param' and 'type'). |
Method | check |
Undocumented |
Method | check |
Undocumented |
Method | check |
Undocumented |
Method | check |
Undocumented |
Method | visit |
Called for function and method definitions (def). |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Class Variable | constructor |
Undocumented |
Class Variable | msgs |
Undocumented |
Class Variable | name |
Name of the provider. |
Class Variable | not |
Undocumented |
Class Variable | options |
Options provided by this provider. |
Method | _add |
Adds a message on :param:`node` for the missing exception type. |
Method | _compare |
Compare the found argument names with the expected ones and generate a message if there are extra arguments found. |
Method | _compare |
Compare the found argument names with the ignored ones and generate a message if there are ignored arguments found. |
Method | _compare |
Compare the found argument names with the expected ones and generate a message if there are arguments missing. |
Inherited from BaseChecker
:
Method | __eq__ |
Permit to assert Checkers are equal. |
Method | __gt__ |
Sorting of checkers. |
Method | __hash__ |
Make Checker hashable. |
Method | __init__ |
Checker instances should have the linter as argument. |
Method | __repr__ |
Undocumented |
Method | __str__ |
This might be incomplete because multiple classes inheriting BaseChecker can have the same name. |
Method | add |
Undocumented |
Method | check |
Check the consistency of msgid. |
Method | close |
Called after visiting project (i.e set of modules). |
Method | create |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | open |
Called before visiting project (i.e. set of modules). |
Method | reduce |
Undocumented |
Class Variable | enabled |
Undocumented |
Class Variable | reports |
Undocumented |
Instance Variable | linter |
Undocumented |
Property | messages |
Undocumented |
Inherited from _ArgumentsProvider
(via BaseChecker
):
Method | get |
DEPRECATED: Return the dictionary defining an option given its name. |
Method | level |
Undocumented |
Method | load |
DEPRECATED: Initialize the provider using default values. |
Method | option |
DEPRECATED: Get the config attribute corresponding to opt. |
Method | option |
DEPRECATED: Get the current value for the given option. |
Method | options |
DEPRECATED. |
Method | options |
DEPRECATED: Return an iterator on options grouped by section. |
Method | set |
DEPRECATED: Method called to set an option (registered in the options list). |
Class Variable | option |
Option groups of this provider and their descriptions. |
Property | config |
Undocumented |
Property | level |
Undocumented |
Instance Variable | _arguments |
The manager that will parse and register any options provided. |
Instance Variable | _level |
Undocumented |
Docstring
, arguments_node: astroid.Arguments
, warning_node: astroid.NodeNG
, accept_no_param_doc: bool|None
= None):
(source)
¶
Check that all parameters are consistent with the parameters mentioned in the parameter documentation (e.g. the Sphinx tags 'param' and 'type'). * Undocumented parameters except 'self' are noticed. * Undocumented parameter types except for 'self' and the ``*<args>`` and ``**<kwargs>`` parameters are noticed. * Parameters mentioned in the parameter documentation that don't or no longer exist in the function parameter list are noticed. * If the text "For the parameters, see" or "For the other parameters, see" (ignoring additional white-space) is mentioned in the docstring, missing parameter documentation is tolerated. * If there's no Sphinx style, Google style or NumPy style parameter documentation at all, i.e. ``:param`` is never mentioned etc., the checker assumes that the parameters are documented in another format and the absence is tolerated. :param doc: Docstring for the function, method or class. :type doc: :class:`Docstring` :param arguments_node: Arguments node for the function, method or class constructor. :type arguments_node: :class:`astroid.scoped_nodes.Arguments` :param warning_node: The node to assign the warnings to :type warning_node: :class:`astroid.scoped_nodes.Node` :param accept_no_param_doc: Whether to allow no parameters to be documented. If None then this value is read from the configuration. :type accept_no_param_doc: bool or None
Docstring
, init_doc: Docstring
, class_node: nodes.ClassDef
):
(source)
¶
Undocumented
Called for function and method definitions (def). :param node: Node for a function or method definition in the AST :type node: :class:`astroid.scoped_nodes.Function`
Adds a message on :param:`node` for the missing exception type. :param missing_exceptions: A list of missing exception types. :param node: The node show the message on.
set[ str]
, message_id: str
, not_needed_names: set[ str]
, expected_argument_names: set[ str]
, warning_node: nodes.NodeNG
):
(source)
¶
Compare the found argument names with the expected ones and generate a message if there are extra arguments found. :param found_argument_names: argument names found in the docstring :param message_id: pylint message id :param not_needed_names: names that may be omitted :param expected_argument_names: Expected argument names :param warning_node: The node to be analyzed
set[ str]
, message_id: str
, ignored_argument_names: set[ str]
, warning_node: nodes.NodeNG
):
(source)
¶
Compare the found argument names with the ignored ones and generate a message if there are ignored arguments found. :param found_argument_names: argument names found in the docstring :param message_id: pylint message id :param ignored_argument_names: Expected argument names :param warning_node: The node to be analyzed
set[ str]
, message_id: str
, not_needed_names: set[ str]
, expected_argument_names: set[ str]
, warning_node: nodes.NodeNG
):
(source)
¶
Compare the found argument names with the expected ones and generate a message if there are arguments missing. :param found_argument_names: argument names found in the docstring :param message_id: pylint message id :param not_needed_names: names that may be omitted :param expected_argument_names: Expected argument names :param warning_node: The node to be analyzed