Skip to content

Run black, which cleared what ruff had to leave behind - #95

Merged
qmohsu merged 1 commit into
mainfrom
claude/black-format
Aug 25, 2026
Merged

Run black, which cleared what ruff had to leave behind#95
qmohsu merged 1 commit into
mainfrom
claude/black-format

Conversation

@qmohsu

@qmohsu qmohsu commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

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 --fix refused, and
recorded that refusing was correct: they sit inside string literals, where
whitespace is content rather than layout, so --unsafe-fixes would have been
the 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

before after
black --check 241 of 299 reformatted 299 unchanged — passes
ruff check 1840 findings 951
mypy core 404 errors 406 — untouched, formatting does not change types

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, the 41 zip() calls without strict=.

Verified by output, not by the argument that formatting is safe

  • Full suite: 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
    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

BASELINE in tests/test_lint_debt_only_shrinks.py is lowered — 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 and the
docstring-vs-string-literal distinction.

🤖 Generated with Claude Code

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>
@qmohsu
qmohsu merged commit e4c5a72 into main Aug 25, 2026
1 check passed
@qmohsu
qmohsu deleted the claude/black-format branch August 25, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant