Python · maintainability
redundant-module-docstring
python:redundant-module-docstring Module docstrings must add information beyond the file path.
- Code
- SARJ099
- Default
- error
- Fix
- none
- Languages
- python
Why
A one-line restatement of a module path duplicates information already visible to readers and search tools.
Fix
Delete the redundant docstring or document an invariant, boundary, consumer, or compatibility constraint.
Before / after
Executed by this rule’s unit tests.
Before
Docstring repeats the module path
"""Logging utilities."""
VALUE = 1
After
Docstring records a module contract
"""Logging utilities redact credentials."""
VALUE = 1
Limits
- Only single-line summary docstrings in non-test implementation modules are checked.
- Special modules, stubs, generated files, multiline documentation, and prose with protected technical facts are excluded.