Skip to content

Conversation

@dmamelin
Copy link
Contributor

@dmamelin dmamelin commented Jan 25, 2026

Why:

  • Speed: Ruff is significantly faster than Black/Flake8/Isort/Bandit, which shortens local checks and CI
  • Single tool: fewer dependencies to install and maintain
  • Unified configuration: all rules and formatting in pyproject.toml, easier to keep consistent
  • Aligned CI and pre-commit: same checks locally and in CI
  • IDE consistency: editors that use Ruff will surface the same diagnostics as CI/pre-commit

BTW: previously Black ran without --check, so it reformatted files on the CI runner instead of failing when formatting was needed.

Changes:

  • Replaced Black/Flake8/Isort/Bandit with Ruff in pre-commit and CI
  • Added Ruff configuration in pyproject.toml
  • Kept pylint and mypy as separate checks
  • Reformat files via ruff
    ruff format is documented as a black replacement, but in tests it reformatted some places more aggressively than expected. I didn’t investigate further since the resulting with patch were actually much clearer. Also, running black
    afterwards doesn’t reformat them back.

The rule set was carefully tuned for the current project state and will likely evolve soon; some pyproject.toml exclusions are temporary and should be removed over time.

The next PR: exception handling rework

@craigbarratt craigbarratt merged commit d0bf316 into custom-components:master Jan 25, 2026
6 checks passed
@craigbarratt
Copy link
Member

Looks great - thanks for the PR!

@ALERTua
Copy link
Contributor

ALERTua commented Jan 25, 2026

yay! modern pre-commit tools! THE FUTURE

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.

3 participants