-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
docstringRelated to docstring linting or formattingRelated to docstring linting or formattingruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
The rule that checks missing documentation for parameters considers empty descriptions as undocumented (undocumented-param, DOC501).
We have a similar rule for exceptions, which considers empty descriptions as documented (docstring-missing-exception, D417).
This example only errors for DOC501:
def func1(arg1: str, arg2: int) -> int:
"""
Args:
arg1:
arg2:
Raises:
ValueError:
"""
try:
return int(arg1) + arg2
except:
raise ValueError("msg") ruff check --select D417,DOC501 --preview example.pyProposal: modify D417 to report an error for empty exception descriptions.
Alternative solution: split undocumented and empty/missing into two separate rules.
This behaviour is especially useful when docstring stubs are auto-generated (#14492)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docstringRelated to docstring linting or formattingRelated to docstring linting or formattingruleImplementing or modifying a lint ruleImplementing or modifying a lint rule