Skip to content

build: pin ruff exactly and exclude Markdown from the formatter - #258

Merged
Olen merged 1 commit into
mainfrom
chore/pin-ruff-exclude-md
Aug 16, 2026
Merged

build: pin ruff exactly and exclude Markdown from the formatter#258
Olen merged 1 commit into
mainfrom
chore/pin-ruff-exclude-md

Conversation

@Olen

@Olen Olen commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

Pins ruff to ==0.16.3 and excludes *.md from the formatter.

Why pin

ruff 0.16 began formatting Python code blocks inside Markdown; 0.15 did not. With a >=0.15.0 floor and fresh resolution in CI, that turned #246 red without any change to the branch — the same commit passed in May and failed in August.

A floating formatter means a commit's CI verdict is not stable over time. On a repo with 41 forks that lands asymmetrically: an outside contributor's PR goes red for something unrelated to their change, and the fix gets bundled into whatever work happened to be in flight.

Pinning does not stall upgrades. An exact pin is precisely the case where Dependabot opens a PR — a >= floor gives it nothing to edit, which is why it has never proposed a ruff bump. So new versions still arrive and still flag latent issues; they just arrive as their own reviewable change.

Dev-only dependency, so nothing is imposed on downstream consumers.

Why exclude Markdown

Doc snippets are illustrative rather than compiled, and the formatter collapses hand-aligned trailing comments that make the examples scannable:

    SpondError,             # base — catch this for any SDK error    ← before
    SpondError,  # base — catch this for any SDK error               ← after

Scoped to [tool.ruff.format], so linting is unaffected.

Testing

  • poetry run ruff format --check → 12 files (was 13; README.md now excluded)
  • poetry run ruff check → all checks passed
  • poetry run pytest → 30 passed

🤖 Generated with Claude Code

ruff 0.16 began formatting Python code blocks inside Markdown, which 0.15
did not. With a `>=0.15.0` floor and fresh resolution in CI, that turned
#246 red without any change to the branch — the same commit passed in May
and failed in August.

Pin exactly so a commit's verdict is stable over time. This does not
stall upgrades: an exact pin is precisely the case where Dependabot opens
a PR, so new ruff versions arrive as their own reviewable change instead
of surfacing on unrelated branches. Dev-only, so nothing is imposed on
consumers.

Also exclude `*.md` from the formatter. Doc snippets are illustrative
rather than compiled, and the formatter collapses hand-aligned trailing
comments that make the examples scannable. Linting is unaffected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Olen
Olen merged commit 569ba66 into main Aug 16, 2026
8 checks passed
@Olen
Olen deleted the chore/pin-ruff-exclude-md branch August 16, 2026 10:26
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