module-attribute-missing-description (PDF716)¶
PDF715 class-attribute-type-mismatch
Next rule →PDF717 module-attribute-type-required
Added in 1.0.0
Never fix
Convention
Part of the PDF rule category.
View source · View documentation source · Search issues
Fix is not available.
Rule is disabled if docstring-convention is none or pep257.
What it does¶
Checks that parsed module attribute entries in owning module docstrings include a prose description.
Only entries that match inventoried module attributes are checked. Attached module attribute docstrings are intentionally not checked by PDF7xx rules.
Why is this useful?¶
Module attribute entries should explain exported state or constants.
Ruff compatibility¶
None.
Examples¶
PDF716 reports module attribute entries without descriptions:
docstring-convention = "google"
"""Module.
Attributes:
timeout (int):
retries:
"""
timeout: int = 1
retries: int = 3
PDF716: Line 4: Module attribute 'timeout' docstring entry is missing a description
PDF716: Line 5: Module attribute 'retries' docstring entry is missing a description
Module attribute entries with descriptions are accepted:
docstring-convention = "google"
"""Module.
Attributes:
timeout (int): Timeout in seconds.
"""
timeout: int = 1
Attached module attribute docstrings are ignored by PDF7xx owning-docstring rules:
docstring-convention = "google"
timeout: int = 1
"""Timeout.
Attributes:
timeout (str):
"""
Options¶
None.
PDF715 class-attribute-type-mismatch
Next rule →PDF717 module-attribute-type-required