-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathruff.toml
More file actions
39 lines (37 loc) · 2.51 KB
/
Copy pathruff.toml
File metadata and controls
39 lines (37 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
line-length = 100
# Must not exceed the `requires-python` floor every pyproject in this workspace declares
# (`>=3.14`). The rule is unchanged and still pinned by `tests/test_packaging.py`; what changed
# is the floor.
#
# This said `py311` for a concrete reason, now spent: under `py314` against a `>=3.11` floor,
# `ruff format` rewrote `except (OverflowError, OSError, ValueError):` into PEP 758's
# unparenthesised form -- a SyntaxError on 3.11, 3.12 and 3.13, all of which the metadata then
# invited. A formatter that can silently emit syntax the package cannot run is worse than no
# formatter. With the floor at 3.14 there is no interpreter left that cannot parse it, so the
# hazard is gone rather than merely tolerated, and `py314` is the honest target.
target-version = "py314"
# ── THE FORMATTER IS GATED, SO IT IS ALSO SETTLED (#783) ──────────────────────────────────────
#
# `ruff format --check .` runs in `ci.yml` and `release.yml`. Before #783 it ran nowhere, and 197
# of 496 files had drifted out of the format this file configures -- so a contributor who ran the
# formatter on a file they touched reformatted regions they had not, and those hunks landed in
# PRs whose bodies said "no behaviour change". #780 shipped six of them.
#
# The gate is WHOLE-TREE, where `ruff check` in the same workflows is scoped to `keel tests
# packages`. Lint has a debt in `docs/` and `scripts/`; formatting no longer has one anywhere,
# and scoping the check would re-open exactly the drift the one-shot pass closed.
#
# The PEP 758 note above is the reason this could be turned on at all: the pass rewrote 38
# `except (A, B):` into `except A, B:`, which is what that note predicted and what the `>=3.14`
# floor now makes safe. `tests/test_python_floor.py` pins that floor across all eight
# distributions, so the syntax cannot outlive the interpreter that parses it. The rewrite is
# provably neutral rather than merely believed to be: the two forms parse to a byte-identical
# AST, and all 197 reformatted files were AST-compared against the commit before the pass.
#
# (38, not the 28 this first said. The miscount came from a regex that required the FIRST
# exception name to end in `Error`, which missed ten. It is the one number justifying the
# change, so it is the one number that had to be measured rather than estimated.)
[lint]
select = ["E", "F", "I", "UP"]
# UP042: the design spec pins `class X(str, Enum)` explicitly (not `StrEnum`) for these types.
ignore = ["UP042"]