Apply tree-wide ruff format and enforce it in CI #20

Open
opened 2026-06-24 01:07:18 +00:00 by rbrooks · 0 comments
Owner

Background

CI runs ruff check (lint) on webapp/backend/ but not ruff format --check. When the CI expansion (PR #19) was set up, enabling the format gate would have reformatted ~105 of 155 backend files — too large to bundle into that PR, so the format check was deliberately left out.

Task

In a dedicated PR:

  1. Run ruff format webapp/backend/ across the whole backend tree (ruff 0.4.4, to match .pre-commit-config.yaml and the webapp/backend/ruff.toml config).
  2. Re-add the format gate to .forgejo/workflows/ci.yml in the lint-backend job:
    - name: Ruff format check
      run: ruff format --check webapp/backend/
    
  3. Note: black is also in requirements-dev.txt. Decide whether to keep both or standardise on ruff format to avoid formatter conflicts.

Why it's separate

A ~105-file reformat is noisy to review and would conflict with other in-flight branches. Doing it on its own keeps the diff reviewable and isolates any churn.

Acceptance

  • ruff format --check webapp/backend/ passes on main.
  • The format check is a required CI / * status.
## Background CI runs `ruff check` (lint) on `webapp/backend/` but **not** `ruff format --check`. When the CI expansion (PR #19) was set up, enabling the format gate would have reformatted ~105 of 155 backend files — too large to bundle into that PR, so the format check was deliberately left out. ## Task In a dedicated PR: 1. Run `ruff format webapp/backend/` across the whole backend tree (ruff 0.4.4, to match `.pre-commit-config.yaml` and the `webapp/backend/ruff.toml` config). 2. Re-add the format gate to `.forgejo/workflows/ci.yml` in the `lint-backend` job: ```yaml - name: Ruff format check run: ruff format --check webapp/backend/ ``` 3. Note: `black` is also in `requirements-dev.txt`. Decide whether to keep both or standardise on `ruff format` to avoid formatter conflicts. ## Why it's separate A ~105-file reformat is noisy to review and would conflict with other in-flight branches. Doing it on its own keeps the diff reviewable and isolates any churn. ## Acceptance - `ruff format --check webapp/backend/` passes on `main`. - The format check is a required `CI / *` status.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rbrooks/Quest-Board#20
No description provided.