Skip to content
0

line-overflow

The *-line-length caps are hard constraints, and every shaping rule resolves within them, so a call, collection, signature, or import that crosses its cap reshapes to one entry per line, and an alignment run reshapes an over-budget member before aligning. When no legal form satisfies the cap (a deep indent, a long identifier, a single-name import already at its narrowest, a cap set below what the statement needs), the narrowest form stands and

names it, so an unsatisfiable cap reads as a finding in prose check and as a squiggle in the sandbox rather than as a knob that did nothing.

A line inside an import statement answers to import-line-length, every other line to code-line-length. A line a layout rule could still split (an inline call carrying arguments, a multi-element collection, a multi-name from import, a signature carrying parameters, a single-statement match arm, a leading docstring) is left for that rule, so

surfaces only the remainder no split can shorten. The lint is non-rewriting, so the diagnostic surfaces without touching the source.

Configuration

KeyTypeDefaultMeaning
enabledbooltrueToggle the rule on or off

The Canonical Case

An attribute-target assignment carries no call, collection, import, or signature a layout rule could split, so once it crosses code-line-length no legal form brings it within the cap. line-overflow names the narrowest form that stands, turning an unsatisfiable cap into a finding rather than a knob that did nothing.

python
metrics.rolling.window.average = previous_value

More Examples

For per-line opt-outs, the Suppression chapter covers the # prose: ignore[line-overflow] directive. The Lengths section of the configuration reference states the caps-are-hard-constraints contract this rule closes.