Review: Python repo standards: ruff pre-commit hooks + repo setup template

review-55-2026-03-28-r4 Doc

review ready

Verdict: READY

Fourth review (re-review) of board item #55 / Forgejo issue #29. Prior three reviews returned NEEDS_REFINEMENT. Issue body has been substantially rewritten with all 3 scope decisions resolved (line-length=88, E/F/I/W rules, archives excluded), 4-workstream decomposition added, and 6-repo scope table included. Traceability labels added to board item. This review validates the rewrite against codebase state as of 2026-03-28.

Template Completeness

  • [x] Type -- Feature
  • [x] Lineage -- Board, Story, Arch all listed
  • [x] Repo -- forgejo_admin/pal-e-platform (tracking issue, child work spans 6 repos)
  • [x] User Story -- "As a platform operator, I want all Python repos to enforce code formatting before CI..."
  • [x] Context -- Explains CI failure loop, scope decisions documented inline
  • [x] File Targets -- Per-repo targets: pyproject.toml, .pre-commit-config.yaml, .woodpecker.yaml
  • [x] Acceptance Criteria -- 5 items
  • [x] Test Expectations -- 3 per-repo verification commands
  • [x] Constraints -- One PR per repo, archives excluded, claude-custom hooks complementary
  • [x] Checklist -- 4 items
  • [x] Related -- claude-custom, service-onboarding-sop, prior review note

Traceability

  • [x] story:superuser-deploy label -- present on board item #55
  • [x] arch:ci-pipeline label -- present on board item #55
  • [x] arch:developer-tooling label -- present on board item #55
  • [x] Forgejo issue -- forgejo_admin/pal-e-platform#29, OPEN

File Targets

Verified all 6 repos in scope against codebase. Audit table:
Repo Local path pyproject.toml [tool.ruff] Current line-length Current lint select .pre-commit-config CI ruff step
pal-e-api ~/pal-e-docs YES 100 E,F,I,N,W YES YES
basketball-api ~/basketball-api YES 100 E,F,I,N,W NO YES
minio-sdk ~/minio-sdk YES 120 E,F,W,I NO YES
minio-api ~/minio-api YES 120 E,F,W,I NO YES
pal-e-mcp ~/pal-e-mcp YES 120 E,F,W,I NO YES
gmail-mcp TBD (not cloned) YES 120 (py310!) E,F,W,I NO YES
Key findings:
  • [x] pal-e-api (~/pal-e-docs) -- already FULLY remediated (has .pre-commit-config.yaml + CI ruff steps). Listed in scope but needs no work beyond config alignment (line-length 100->88, drop N rule). Minor nit, not a blocker.
  • [x] basketball-api -- needs .pre-commit-config.yaml, config alignment (100->88, drop N rule). CI ruff already present.
  • [x] minio-sdk -- needs .pre-commit-config.yaml, config alignment (120->88). CI ruff already present.
  • [x] minio-api -- needs .pre-commit-config.yaml, config alignment (120->88). CI ruff already present.
  • [x] pal-e-mcp -- needs .pre-commit-config.yaml, config alignment (120->88). CI ruff already present.
  • [x] gmail-mcp -- needs .pre-commit-config.yaml, config alignment (120->88, py310->py312?). CI ruff already present. Not cloned locally.
All 6 repos already have CI ruff steps in .woodpecker.yml/.yaml. The AC item "CI pipelines include ruff check step" is already satisfied for all repos in scope. The remaining work per repo is: (1) align pyproject.toml to standard config (line-length=88, select=E,F,I,W), (2) add .pre-commit-config.yaml (5 repos need it; pal-e-api already has it).

Repo Placement

OK. Tracking issue correctly filed on pal-e-platform. Child work will create per-repo issues. Decomposition section properly identifies this.

Dependencies

  • No blocking items on board-pal-e-platform. Item #55 is in todo column.
  • #411 (Harbor CI bug) is in_progress but unrelated to ruff standardization.
  • Workstream 1 (convention note) must complete before workstream 2 (per-repo remediation) can start. Issue correctly sequences these.
  • Existing claude-custom hooks (auto-ruff-format.sh, check-ruff-before-commit.sh) are acknowledged as complementary.

Acceptance Criteria

5 AC items assessed:
  • "Standard ruff config defined and documented in convention note" -- verifiable, clear scope (line-length=88, select=E,F,I,W)
  • "All 6 repos have matching pyproject.toml ruff config" -- verifiable via grep/read
  • "All 6 repos have .pre-commit-config.yaml with ruff hook" -- verifiable via file existence check
  • "CI pipelines include ruff check step" -- ALREADY TRUE for all 6 repos. Agent can verify but no work needed.
  • "service-onboarding-sop updated with ruff requirement" -- verifiable by reading the SOP note
All AC are agent-verifiable. AC #4 is pre-satisfied.

Blast Radius

  • Line-length change from 100/120 to 88 will cause mass reformatting diffs in all 6 repos. This was a deliberate scope decision. Each repo gets its own PR, so blast radius is contained per-repo.
  • Dropping "N" (naming) rule from pal-e-api and basketball-api removes 2 lint rules. This is relaxation, not tightening -- no new failures.
  • pal-e-sdk (~/pal-e-docs-sdk, Forgejo: forgejo_admin/pal-e-sdk) is a Python repo NOT in scope. It has ruff config (120, E/F/W/I), no .pre-commit-config.yaml. Not an archive candidate. Nit: should be added to scope or explicitly excluded with rationale.
  • pal-e-dora-exporter exists on Forgejo with Python source but has no pyproject.toml (uses requirements.txt). Not a standard Python project -- reasonable to exclude.
  • gmail-mcp uses target-version="py310" while standard is py312. The convention note should specify target-version or declare it repo-specific.

Decomposition

Issue decomposes into 4 workstreams:
  • Convention note (Dottie task) -- single agent, <5 min
  • Per-repo remediation -- 6 agents (one per repo), each <5 min (align config + add .pre-commit-config.yaml + run ruff format)
  • CI standardization -- already done for all 6 repos (no work needed)
  • SOP update (Dottie task) -- single agent, <5 min
Each workstream fits the 5-minute rule. Decomposition is adequate. No template-board needed -- the 4 workstreams can be tracked as sub-issues on this tracking issue or as individual board items.

Recommendation

Verdict: READY with minor nits (non-blocking).
All prior NEEDS_REFINEMENT findings have been addressed. Scope decisions resolved, decomposition defined, traceability labels present, file targets verified. The ticket is dispatchable.
Non-blocking nits for awareness (can be fixed during execution):
  • [BODY] pal-e-sdk (~/pal-e-docs-sdk) is missing from scope. Active Python repo, not an archive candidate. Add to repos table or add exclusion rationale.
  • [BODY] AC #4 ("CI pipelines include ruff check step") is already satisfied for all 6 repos. Could note this as pre-satisfied to avoid unnecessary work.
  • [BODY] Workstream 3 (CI standardization) says "ensure each repo's .woodpecker.yaml has ruff check + ruff format --check steps" but all 6 repos already have this. Workstream 3 is a no-op verification pass.
  • [BODY] gmail-mcp target-version is py310 (all others py312). Convention note should specify whether target-version is part of the standard or repo-specific.