style: apply tree-wide ruff format and enforce it in CI (#20) #161
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/20-ruff-format-tree"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
CI ran
ruff check(lint) but neverruff format --check, so the backend tree had never been uniformly formatted. This reformats it with the pinned ruff version and adds the format gate.Changes
webapp/backend/with ruff 0.4.4 (the version in.pre-commit-config.yaml/ CI): 108 files reformatted, behaviour unchanged.ruff format --check webapp/backend/step to thelint-backendjob.unlinked_memberrelationship moved its# noqa: F821off the forward-ref line, so the suppression stopped applying andruff checkfailed. Repositioned the noqa onto the annotation line — format + check both clean and stable.requirements-dev.txt: pin ruff back to0.4.4to match the hook and CI (ruff format output is version-sensitive — all three must agree;requirements-devhad drifted to 0.15.21). Dropblack(unused;ruff formatis the single formatter now).renovate.json: hold ruff (requirements + pre-commit) at its pin so it can't drift and silently break the format gate.Note on ruff version
The issue specified 0.4.4, matching the pre-commit hook and the CI
ruff check.requirements-dev.txthad separately drifted to 0.15.21 (Renovate) — reconciled back to 0.4.4 here so the formatter is identical everywhere. A deliberate ruff upgrade (bumping the hook + reformatting together) can be a separate change.Verification
ruff format --check webapp/backend/→ clean (160 files).ruff check webapp/backend/→ All checks passed.Closes #20
🤖 Generated with Claude Code