Docstrings follow the same legibility discipline as code. Wrap to the docstringbudget, put a one-line docstring's opener, body, and closer on lines of their own, and keep the quote style consistent throughout.
Trailing commas come off, blank lines snap to canonical counts, backslash continuations and redundant -> Noneannotations fall away, and a stale __future__ import is removed once nothing needs it. The scaffolding clears after the shape is set.
Calls, signatures, collections, and from-imports that outgrow the line budgetexplode to one entry per line. Each argument, key, or name lands on its own row, so the eye reads down the column and a later edit touches a single line.
Missing signature annotations, reassigned constants, step-narration comments, bare imports, and bindings whose value inlines for free are reported as findings. The formatter never rewrites these, because the fix belongs to the reader.
Sibling entries sort into a predictable order. Imports, dictionary keys, and set members read top-to-bottom by name, so a reader looking for an entry already knows where it sits.
Docstrings follow the same legibility discipline as code. Wrap to the docstringbudget, put a one-line docstring's opener, body, and closer on lines of their own, and keep the quote style consistent throughout.
Trailing commas come off, blank lines snap to canonical counts, backslash continuations and redundant -> Noneannotations fall away, and a stale __future__ import is removed once nothing needs it. The scaffolding clears after the shape is set.
Calls, signatures, collections, and from-imports that outgrow the line budgetexplode to one entry per line. Each argument, key, or name lands on its own row, so the eye reads down the column and a later edit touches a single line.
Missing signature annotations, reassigned constants, step-narration comments, bare imports, and bindings whose value inlines for free are reported as findings. The formatter never rewrites these, because the fix belongs to the reader.
Sibling entries sort into a predictable order. Imports, dictionary keys, and set members read top-to-bottom by name, so a reader looking for an entry already knows where it sits.