chore: replace black with ruff format in template toolchain #25

Open
opened 2026-02-28 14:25:26 +01:00 by Philipp · 1 comment
Owner

To unify the linting and formatting toolchain and improve performance, we should switch from black to ruff format. This transition has already been successfully implemented in the opos2 project (PR #373).

Proposed Changes:

  • .pre-commit-config.yaml:
    • Remove the https://github.com/psf/black repository entry.
    • Add the ruff-format hook to the existing https://github.com/astral-sh/ruff-pre-commit entry.
  • pyproject.toml:
    • Remove black from all dependency groups (e.g., develop, lint).
    • Delete the [tool.black] configuration section.
  • Action:
    • Run ruff format . to ensure the template codebase is formatted according to the new standard.
    • Synchronize the lock file (e.g., poetry lock).

This change will reduce the number of tools required in the CI/CD pipeline and local development environments.

To unify the linting and formatting toolchain and improve performance, we should switch from `black` to `ruff format`. This transition has already been successfully implemented in the `opos2` project (PR #373). ### Proposed Changes: - **`.pre-commit-config.yaml`**: - Remove the `https://github.com/psf/black` repository entry. - Add the `ruff-format` hook to the existing `https://github.com/astral-sh/ruff-pre-commit` entry. - **`pyproject.toml`**: - Remove `black` from all dependency groups (e.g., `develop`, `lint`). - Delete the `[tool.black]` configuration section. - **Action**: - Run `ruff format .` to ensure the template codebase is formatted according to the new standard. - Synchronize the lock file (e.g., `poetry lock`). This change will reduce the number of tools required in the CI/CD pipeline and local development environments.
Author
Owner

Note: When implementing this change, it is crucial to run ruff format . immediately after updating the configuration to ensure all files in the repository are consistent with the new formatter. This should be committed along with the configuration changes to avoid CI failures.

Note: When implementing this change, it is crucial to run `ruff format .` immediately after updating the configuration to ensure all files in the repository are consistent with the new formatter. This should be committed along with the configuration changes to avoid CI failures.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Philipp/template-git#25