-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
-
DOC101
Docstring contains fewer arguments than in function signature -
DOC102
Docstring contains more arguments than in function signature -
DOC103
Docstring arguments are different from function arguments -
DOC104
Arguments are the same in the docstring and the function signature, but are in a different order -
DOC105
Argument names match, but type hints do not match -
(covered byDOC106
The option--arg-type-hints-in-signature
isTrue
but there are no argument type hints in the signatureANN
) -
(covered byDOC107
The option--arg-type-hints-in-signature
isTrue
but not all args in the signature have type hintsANN
) -
(covered byDOC108
The option--arg-type-hints-in-signature
isFalse
but there are argument type hints in the signatureANN
) -
DOC109
The option--arg-type-hints-in-docstring
isTrue
but there are no type hints in the docstring arg list -
DOC110
The option--arg-type-hints-in-docstring
isTrue
but not all args in the docstring arg list have type hints -
DOC111
The option--arg-type-hints-in-docstring
isFalse
but there are type hints in the docstring arg list -
DOC201
Function/method does not have a return section in docstring -
DOC202
Function/method has a return section in docstring, but there are no return statements or annotations -
DOC203
Return 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 -
DOC302
The class docstring does not need a "Returns" section, because__init__()
cannot return anything -
DOC303
The__init__()
docstring does not need a "Returns" section, because it cannot return anything -
DOC304
Class docstring has an argument/parameter section; please put it in the__init__()
docstring -
DOC305
Class docstring has a "Raises" section; please put it in the__init__()
docstring -
DOC306
The class docstring does not need a "Yields" section, because__init__()
cannot yield anything -
DOC307
The__init__()
docstring does not need a "Yields" section, because__init__()
cannot yield anything -
DOC401
(Deprecated; this violation code no longer appears) -
DOC402
Function/method has "yield" statements, but the docstring does not have a "Yields" section -
DOC403
Function/method has a "Yields" section in the docstring, but there are no "yield" statements, or the return annotation is not a Generator/Iterator/Iterable -
DOC404
The types in the docstring's Yields section and the return annotation in the signature are not consistent -
DOC501
Function/method has "raise" statements, but the docstring does not have a "Raises" section -
DOC502
Function/method has a "Raises" section in the docstring, but there are not "raise" statements in the body -
DOC601
Class docstring contains fewer class attributes than actual class attributes -
DOC602
Class docstring contains more class attributes than in actual class attributes -
DOC603
Class docstring attributes are different from actual class attributes -
DOC604
Attributes are the same in docstring and class def, but are in a different order -
DOC605
Attribute names match, but type hints in these attributes do not match
Style support
T-256, airreality, edgarrmondragon, ddelange, nathanjmcdougall and 47 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