Skip to content

Simplify toolchain by consolidating Black and isort into Ruff #15

Description

@z80020100

Background

The current code quality toolchain has functional overlap between three formatting/linting tools:

Tool Purpose Overlap
Ruff Linter + Formatter (primary) ruff format is Black-compatible; I rules handle isort
Black Formatter (fallback) Fully covered by ruff format
isort Import sorting Fully covered by Ruff I lint rules

In pre-commit hooks, ruff-format, black, and isort all run sequentially — producing the same result with redundant processing.

Proposed Changes

Remove Black and isort and keep Ruff + MyPy only.

pyproject.toml

  • Remove black and isort from [dependency-groups] dev
  • Delete [tool.black] section
  • Delete [tool.isort] section

.pre-commit-config.yaml

  • Remove black hook (https://github.com/psf/black)
  • Remove isort hook (https://github.com/pycqa/isort)

.vscode/settings.json

  • Change default formatter from ms-python.black-formatter to charliermarsh.ruff

Result

  • No functional change — formatting rules and import sorting behavior remain identical
  • Fewer dev dependencies (2 fewer packages)
  • Faster pre-commit runs (fewer redundant passes)
  • Single source of truth for formatting configuration ([tool.ruff] / [tool.ruff.format])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions