Variable: PY_LINE_LENGTH
constPY_LINE_LENGTH:88=88
A small Python printer whose output ruff format (Black style, line length
88) leaves unchanged, so the service can emit Python without running Ruff
(decision D1).
The rules are Black's for the expression shapes the lifter produces (calls, keyword arguments, dicts, lists, subscripts, comparisons, attribute chains, string and number literals):
- A line that fits in 88 columns stays on one line, without a trailing comma.
- Otherwise the last bracket pair on the line is split. If the bracket's contents fit on one line at the next indent, they go there with no trailing comma ("hugging" the brackets).
- Otherwise, with two or more elements, every element goes on its own line with a trailing comma, and each element line is formatted recursively. A single element is formatted recursively on its own line, without a trailing comma.
- Import lists always split one name per line with a trailing comma.
- A too-long
name = <atom>gets its right-hand side wrapped in parentheses when the atom then fits.
The fixture suite runs ruff format --check over every generated file.