-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
docstringRelated to docstring linting or formattingRelated to docstring linting or formattingpluginImplementing a known but unsupported pluginImplementing a known but unsupported plugin
Description
This issue tracks the implementation of pydoclint. Following discussion in #11471 it was decided to prefer pydoclint over darglint for implementation in ruff, since they cover mostly the same ruleset, and pydoclint is still actively developed (unlike darglint). This issue should then supersede #458.
Rules
-
DOC101Docstring contains fewer arguments than in function signature -
DOC102Docstring contains more arguments than in function signature -
DOC103Docstring arguments are different from function arguments -
DOC104Arguments are the same in the docstring and the function signature, but are in a different order -
DOC105Argument names match, but type hints do not match -
(covered byDOC106The option--arg-type-hints-in-signatureisTruebut there are no argument type hints in the signatureANN) -
(covered byDOC107The option--arg-type-hints-in-signatureisTruebut not all args in the signature have type hintsANN) -
(covered byDOC108The option--arg-type-hints-in-signatureisFalsebut there are argument type hints in the signatureANN) -
DOC109The option--arg-type-hints-in-docstringisTruebut there are no type hints in the docstring arg list -
DOC110The option--arg-type-hints-in-docstringisTruebut not all args in the docstring arg list have type hints -
DOC111The option--arg-type-hints-in-docstringisFalsebut there are type hints in the docstring arg list -
DOC201Function/method does not have a return section in docstring -
DOC202Function/method has a return section in docstring, but there are no return statements or annotations -
DOC203Return type(s) in the docstring not consistent with the return annotation -
DOC301__init__()should not have a docstring; please combine it with the docstring of the class -
DOC302The class docstring does not need a "Returns" section, because__init__()cannot return anything -
DOC303The__init__()docstring does not need a "Returns" section, because it cannot return anything -
DOC304Class docstring has an argument/parameter section; please put it in the__init__()docstring -
DOC305Class docstring has a "Raises" section; please put it in the__init__()docstring -
DOC306The class docstring does not need a "Yields" section, because__init__()cannot yield anything -
DOC307The__init__()docstring does not need a "Yields" section, because__init__()cannot yield anything -
DOC401(Deprecated; this violation code no longer appears) -
DOC402Function/method has "yield" statements, but the docstring does not have a "Yields" section -
DOC403Function/method has a "Yields" section in the docstring, but there are no "yield" statements, or the return annotation is not a Generator/Iterator/Iterable -
DOC404The types in the docstring's Yields section and the return annotation in the signature are not consistent -
DOC501Function/method has "raise" statements, but the docstring does not have a "Raises" section -
DOC502Function/method has a "Raises" section in the docstring, but there are not "raise" statements in the body -
DOC503Exceptions in the “Raises” section in the docstring do not match those in the function body -
DOC504Function/method has assert statements, but the docstring does not have a “Raises” section. (Assert statements could raise “AssertError”.) -
DOC601Class docstring contains fewer class attributes than actual class attributes -
DOC602Class docstring contains more class attributes than in actual class attributes -
DOC603Class docstring attributes are different from actual class attributes -
DOC604Attributes are the same in docstring and class def, but are in a different order -
DOC605Attribute names match, but type hints in these attributes do not match
Style support
T-256, airreality, edgarrmondragon, ddelange, nathanjmcdougall and 50 moreTom-Boscher, tomschr, FBruzzesi, enricostragiotti, rian-dolphin and 1 more
Metadata
Metadata
Assignees
Labels
docstringRelated to docstring linting or formattingRelated to docstring linting or formattingpluginImplementing a known but unsupported pluginImplementing a known but unsupported plugin