Skip to content

Auto-Fix Rules

Auto-fix rules rewrite source as part of prose format and surface as Severity::Format diagnostics under prose check. Each rule resolves a layout question Prose can answer mechanically (alignment columns, alphabetization order, blank-line counts, collection layout, trailing-comma presence) and emits an Edit list the Pipeline applies between rules. Auto-fix rules never report a violation the binary won't itself resolve.

align-colons

Alignment

Aligns the : separator across dict literals, annotated assignments, function-signature annotations, and Google-style docstring sections.

align-comparisons

Alignment

Aligns comparison operators vertically across the operands of a multi-line and-chain or or-chain.

align-equals

Alignment

Aligns the = separator across consecutive single-target assignments, annotated function-parameter defaults, and an exploded call's keyword arguments.

align-imports

Alignment

Aligns the import and as keywords across consecutive import statements.

align-match-case

Alignment

Aligns the post-pattern : across single-expression case bodies inside a match statement.

alphabetize

Ordering

Alphabetizes import siblings, dict-key blocks, and class-body members.

band-constants

Ordering

Hoists module-level constants into a leading band below the imports and a trailing band beneath the definitions.

blank-lines

Formatting

Normalizes blank-line counts to canonical values between thematically adjacent statements.

call-layout

Layout

Explodes a keyword-expressible call carrying more than the inline-argument cap to one keyword argument per line.

collection-layout

Layout

Splits list, tuple, dict, and set literals into one-entry-per-line layout once they overflow their width, or a dict crosses an entry-count cap.

docstring-expand

Docs

Expands a one-line docstring into the multi-line block shape.

docstring-frame

Docs

Canonicalizes a docstring's quotes and frames the opener and closer.

docstring-wrap

Docs

Wraps multi-line docstring bodies at the configured measure.

group-imports

Ordering

Partitions a module's imports into bare, external from, and local-package sections.

import-layout

Layout

Splits an over-budget from ... import ... into a run of repeated-prefix statements packed to the import budget.

shed-parentheses

Formatting

Sheds a grouping parenthesis pair that binds nothing, reflowing the expression onto the line it now fits.

signature-layout

Layout

Normalizes function signatures to one line or one parameter per line, gated by line length and inline-parameter count.

strip-align-padding

Alignment

Strips padding that lines up with nothing and settles the gap after a colon, in one-member alignment groups and just inside bracket delimiters.

strip-none-return

Formatting

Drops a redundant -> None return annotation, since an omitted one already reads as returning nothing.

strip-trailing-commas

Formatting

Removes trailing commas from collections, signatures, calls, and every other bracketed container.

unused-future-annotations

Formatting

Removes from __future__ import annotations lines that no longer carry their weight on the target Python version.

For the deterministic order these rules fire in, see the Pipeline Order reference. For the per-rule facets, see the Configuration reference. For the lint rules that surface diagnostics without rewriting, see the Lint landing.