Skip to content

replace black with ruff format and update ruff to 0.17.0 - #65

Merged
bentsku merged 1 commit into
ruff-format-codefrom
ruff-format
Oct 14, 2026
Merged

bentsku merged 1 commit into
ruff-format-codefrom
ruff-format

Conversation

@bentsku

@bentsku bentsku commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

The dev tools were pinned to black 23.10.0 and ruff 0.1.0, both from October 2023. ruff format is a drop-in replacement for black, so we don't need black in addition to ruff. With the current code, the latest black (26.10.1) and ruff format 0.17.0 reformat the same 12 files, and their output differs in a single assert statement.

Changes

  • Remove black and use ruff format / ruff format --check in make format and make lint.
  • Pin ruff==0.17.0 (formatters change their style between versions, so they stay pinned).
  • Move select / ignore to [tool.ruff.lint], since the top-level settings are deprecated.
  • Replace --show-source, which newer ruff versions removed, with --output-format=full.
  • Use black's line length of 100 for ruff too (it was 110 for ruff, which only mattered for B950).
  • Only format rolo/ and tests/, like black's include did. ruff 0.17 would also format docs/, examples/, and the Python code blocks in Markdown files.
  • Update the README badge and the "Format code" section.

The formatting itself is in #66, the PR below this one in the stack, so it lands as its own commit on main. This PR only adds the 3 dummy implementations collapsed to one line (def f(): ...), which black 23 didn't accept.

Testing

  • make lint passes with ruff 0.17.0, with no lint findings under the existing rule set.
  • The test suite passes (212 tests).

🤖 Generated with Claude Code

ruff format is a drop-in replacement for black, so black is no longer
needed. ruff 0.1.0 and black 23.10.0 were both from October 2023:

- move the lint settings to [tool.ruff.lint], the top-level ones are
  deprecated
- replace --show-source, which newer ruff versions removed, with
  --output-format=full
- use black's line length of 100, and only format rolo/ and tests/ as black
  did (ruff also formats code blocks in Markdown files)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bentsku
bentsku changed the base branch from main to ruff-format-code October 14, 2026 21:51
@bentsku
bentsku added this pull request to stack #67 October 14, 2026 21:51
@bentsku
bentsku merged commit 6d548d0 into main Oct 14, 2026
14 checks passed
@bentsku
bentsku deleted the ruff-format branch October 14, 2026 21:58
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