align-equals
AlignmentProse aligns the = separator across consecutive single-target assignments and annotated function-parameter defaults.
The : separator appears across the contexts below, wherein columns of values sit beside columns of names and the reader's eye wants a tidy table rather than a ragged margin.
Args: blocks all read as parallel two-column entries. Single-expression match arms live in a separate dispatch table owned by .The rule walks each context independently, treating a group as the consecutive members sharing the same indentation level and parent shape. A blank line, an own-line comment, or a non-member statement resets the group. Alignment honors the
so that one-member contexts skip padding altogether, leaving a one-key dict reading as plain code instead of a one-row table.| Key | Type | Default | Meaning |
|---|---|---|---|
enabled | bool | true | Toggle the rule on or off |
max-shift | positive int | 8 | Ceiling on per-line padding |
max-shift-policy | "split" | "drop" | "split" | How to handle a max-shift. See the per-rule knobs for the full semantics |
max-shift caps the per-line padding the alignment can introduce. When a group's widest member would push the column past the cap, max-shift-policy decides the fallback shape ("split" partitions the group, "drop" excludes the widest members from the padding calculation). The per-rule knobs reference covers the full semantics.
A dictionary literal whose entries have differing key lengths aligns on the : separator, and the reader reads keys and values as separate columns.
capitals = {
"USA" : "Washington",
"France" : "Paris",
"Japan" : "Tokyo",
"Spain" : "Madrid",
}
An
A run mixing commented and bare entries aligns to a single : column across the whole dict rather than splitting at the commented rows, because each comment attaches to its entry rather than to the alignment.
A dict whose entries each carry a trailing comment aligns its : separators on the shared column, with each comment left riding after its value. The comment is an
The phrase Args: appears both in the : column.
Every annotated parameter on a multi-line signature settles its : onto a shared column at the widest name's width. The return-type : closing the signature line sits outside the parameter
A dict mixes string literals, an integer literal, and a bare name reference as keys. The math runs on each key's display width, so the : lines up identically regardless of the key expression's kind.
A dict whose values are themselves dicts has each nested dict aligning its own : column at its own indent. The inner alignment is unaffected by the outer dict's key widths.
A dict mixes key: value entries with a **defaults unpacking. The unpacking carries no key expression, so it drops out of the : column.
Prose aligns the = separator across consecutive single-target assignments and annotated function-parameter defaults.
Prose aligns the import and as keywords across consecutive import statements.
Prose alphabetizes import siblings, dict-key blocks, and
Prose 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.
Prose aligns the post-pattern : across single-expression case bodies inside a match statement.
Prose strips padding from