Skip to content

redundant-class-docstring

Undecorated base-free class docstring only repeats the class name.

Why

A name-only restatement adds maintenance cost without documenting the class contract.

Fix

Remove the restatement after confirming __doc__ is not an external contract. Keep schema descriptions, runtime-consumed prose, hidden invariants, lifetimes, and exclusions.

Examples

Before — flagged Docstring only repeats the class name
app/policy.py
class RetryPolicy:
"""The retry policy."""
attempts: int = 3
After — preferred Docstring adds a concrete constraint
app/policy.py
class RetryPolicy:
"""Retry policy required because the upstream caps concurrency."""
attempts: int = 3

Formerly: class-docstring-restates-name