iay d Z ddlmZ ddlZddlmZ ddlZddlmZ ddlm Z ddlm
Z ddlm
Z
dd lmZ dd
lmZ erddlmZ G d d
e ZddZdS )zHPylint plugin for checking in Sphinx, Google, or Numpy style docstrings. )annotationsN)
TYPE_CHECKING)nodes)BaseChecker)utils)_check_docs_utils) Docstring)HIGH)PyLinterc h e Zd ZdZdZddddddd d
dgifdd
ddd
dgifddddd
dgifdddd
dgifddddddZd d!d"d#d$d%fd&d!d"d#d'd%fd(d!d"d#d)d%fd*d!d"d#d+d%fd,d-d.d/ eej d0d1ffZ d2d3hZ
d4d5hZdad:ZeZ
dbd=Zdbd>Zdbd?ZdcdAZdddCZdedEZeZdfdNZdfdOZdgdQZ dhdidYZdjd^Zdkd`ZdRS )lDocstringParameterCheckera 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``.
parameter_documentation)z@"%s" has constructor parameters documented in class and __init__multiple-constructor-doczAPlease remove parameter declarations in the class or constructor.)z#"%s" not documented as being raisedmissing-raises-docz:Please document exceptions for all raised exception types.)zRedundant returns documentationredundant-returns-docz>Please remove the return/rtype documentation from this method.)zRedundant yields documentationredundant-yields-docz8Please remove the yields documentation from this method.zMissing return documentationmissing-return-docz8Please add documentation about what this method returns. old_names)W9007zold-missing-returns-doc)z!Missing return type documentationmissing-return-type-docz1Please document the type returned by this method.zMissing yield documentationmissing-yield-docz:Please add documentation about what this generator yields.)W9009zold-missing-yields-doc)z Missing yield type documentationmissing-yield-type-docz0Please document the type yielded by this method.z'"%s" missing in parameter documentationmissing-param-docz5Please add parameter declarations for all parameters.)W9003zold-missing-param-docz,"%s" missing in parameter type documentationmissing-type-docz:Please add parameter type declarations for all parameters.)W9004zold-missing-type-doc)z)"%s" differing in parameter documentationdiffering-param-docz-Please check parameter names in declarations.)z."%s" differing in parameter type documentationdiffering-type-docz2Please check parameter names in type declarations.)z,"%s" useless ignored parameter documentationuseless-param-docz2Please remove the ignored parameter documentation.)z1"%s" useless ignored parameter type documentationuseless-type-docz7Please remove the ignored parameter type documentation.)z!Missing any documentation in "%s"missing-any-param-docz/Please add parameter and/or type documentation.)W9005W9006W9008W9010W9011W9012W9013W9014W9015W9016W9017W9018W9019W9020W9021zaccept-no-param-docTynz