Skip to content

Replace black/isort with ruff format#909

Open
korbonits wants to merge 1 commit intoallenai:mainfrom
korbonits:ruff-migration
Open

Replace black/isort with ruff format#909
korbonits wants to merge 1 commit intoallenai:mainfrom
korbonits:ruff-migration

Conversation

@korbonits
Copy link
Copy Markdown

@korbonits korbonits commented Apr 11, 2026

Summary

  • Remove black>=23.1,<24.0 and isort>=5.12,<5.13 from dev dependencies
  • Remove [tool.black] and [tool.isort] sections from pyproject.toml
  • Add [tool.ruff.format] (black-compatible defaults, no extra config needed)
  • Update Makefile run-checks target: replace isort --check . && black --check . with ruff format --check .
  • Apply ruff format to 15 files whose formatting had drifted

Motivation

ruff was already present in dev dependencies and [tool.ruff] was already configured for linting. This completes the migration by replacing the two remaining redundant tools (black + isort) with ruff format, which is black-compatible and handles import sorting via ruff check --select I.

Result: one tool, one config section, same behavior.

Test plan

  • ruff format --check .96 files already formatted
  • ruff check .All checks passed!
  • make run-checks passes (excluding mypy/pytest which require full env)

🤖 Generated with Claude Code

- Remove black>=23.1,<24.0 and isort>=5.12,<5.13 from dev dependencies
- Remove [tool.black] and [tool.isort] sections from pyproject.toml
- Add [tool.ruff.format] section (black-compatible defaults)
- Update Makefile run-checks target: replace isort+black with ruff format --check
- Apply ruff format to 15 files whose formatting had drifted

ruff already existed in dev deps and [tool.ruff] was already configured;
this completes the migration by consolidating formatting into ruff as well.
No logic changes; formatting-only diffs in source files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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