Skip to content

Docs Rules

The docs rules read against the PEP 257 docstring set discovered by the Docstring walker and reshape the body, the quote placement, or both. Description prose between the opening """ and the first section heading reads against docstring-line-length (default 76), while every Title-case-headed section that follows reads against code-line-length (default 88) or both collapse to one budget when docstring-structured-policy = "docstring-line-length".

docstring-expand

Docs

Prose expands a one-line docstring into the multi-line block shape.

docstring-frame

Docs

Prose drops a multi-line docstring's opener and closer onto their own lines.

docstring-wrap

Docs

Prose wraps multi-line docstring bodies at the configured measure.

For the docstring-budget duality and the docstring-structured-policy knob, see the Configuration reference. For the walker that finds every docstring in source order, see the Docstring primitive page.