Skip to content

Formatting Rules

The formatting rules clear the small scaffolding that clutters a statement once its shape is settled, normalizing blank-line counts between definitions, shedding grouping parentheses that bind nothing, dropping a redundant -> None, stripping trailing commas, and removing a from __future__ import annotations that no longer earns its place on the target version. Each rewrite is narrower than a layout rule and more pervasive than an ordering rule, tidying what the eye reads without touching the structure it reads.

blank-lines

Formatting

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

shed-parentheses

Formatting

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

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 enabling or disabling any of these rules, see the Configuration reference. For the pipeline order they fire in, see the Pipeline Order reference.