Run black, which cleared what ruff had to leave behind - #95
Merged
Conversation
CLAUDE.md recorded black as deliberately deferred: 241 files reformatted is a
diff nobody can review, worth doing in its own commit when no other session is
mid-flight. Checked before starting -- seven remote branches, zero open PRs, and
all seven are merged leftovers, so nothing was in flight.
**The interesting result is not that black passes now, it is what it fixed.**
The previous pass recorded 907 W291/W293 that `ruff --fix` refused, correctly:
they sit inside string literals, where whitespace is content rather than layout,
and reaching for --unsafe-fixes there would have been wrong. Black cleared 889
of them -- because black knows which triple-quoted strings are *docstrings* and
normalises those, where ruff could only see a string and had to stop.
So the rule that came out of the earlier pass needs its sharper form: a tool
declining an unsafe fix is still not something to override, but the answer is a
tool that can tell the difference. The twelve W293 that survive both are in
argparse `epilog=` strings -- not docstrings, and their blank lines are printed.
black --check 241 of 299 reformatted -> 299 unchanged, passes
ruff check 1840 findings -> 951
mypy core 404 errors -> 406, untouched
mypy is the honest remaining gap and the one of the four that would be red on
arrival and stay red. What is left in ruff is mostly not lint: 727 annotation
modernisations the 3.10 floor made available, then ~140 with real content, B905
first.
**Verified by output, not by the argument that formatting is safe.** The full
suite reads 3404 passed / 21 skipped before and after, on trees checked to be
identical beforehand; only `.py` changed, no figure or data byte moved. The
README transcripts and the figure gate are what would have said otherwise.
BASELINE in tests/test_lint_debt_only_shrinks.py is lowered accordingly -- W291
deleted at zero, W293 down to 12 -- since that ratchet fails on a stale baseline
as well as a grown one. README and CLAUDE.md carry the new numbers.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CLAUDE.md recorded black as deliberately deferred — 241 files reformatted is a
diff nobody can review, worth doing in its own commit when no other session is
mid-flight. Checked before starting: seven remote branches, zero open PRs,
and all seven verified as merged leftovers.
The interesting result is not that black passes now
The previous lint pass recorded 907 W291/W293 that
ruff --fixrefused, andrecorded that refusing was correct: they sit inside string literals, where
whitespace is content rather than layout, so
--unsafe-fixeswould have beenthe wrong answer.
Black cleared 889 of them — because black knows which triple-quoted strings
are docstrings and normalises those, where ruff could only see a string and
had to stop.
So the rule from that pass needs its sharper form: a tool declining an unsafe
fix is still not something to override — but the answer is a tool that can tell
the difference. The twelve W293 that survive both sit in argparse
epilog=strings, which are not docstrings and whose blank lines get printed.
Numbers
black --checkruff checkmypy coremypyis the honest remaining gap, and the one of the four that would be red onarrival and stay red. What is left in ruff is mostly not lint: 727 annotation
modernisations the 3.10 floor made available, then ~140 with real content —
B905first, the 41zip()calls withoutstrict=.Verified by output, not by the argument that formatting is safe
be identical beforehand.
.pychanged. No figure or data byte moved.if it were not mechanical — that is why they exist, and why "black is a
formatter so it must be fine" was not accepted as the evidence.
Also updated
BASELINEintests/test_lint_debt_only_shrinks.pyis lowered —W291deletedat zero,
W293down to 12 — since that ratchet fails on a stale baseline aswell as a grown one. README and CLAUDE.md carry the new numbers and the
docstring-vs-string-literal distinction.
🤖 Generated with Claude Code