Python repo standards: ruff pre-commit hooks + repo setup template #29
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-platform#29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Type
Feature
Lineage
Repo
forgejo_admin/pal-e-platform(tracking issue — child work spans 6 repos + claude-custom)User Story
As a platform operator, I want all Python repos to enforce code formatting before CI so that CI never fails on formatting and agents produce clean code from the start.
Context
Multiple Python repos fail CI on
ruff format --checkbecause there are no pre-commit hooks. Devs and agents push unformatted code, CI catches it too late. With Woodpecker logs currently broken, these failures are invisible. This is whack-a-mole without a platform standard.Scope decisions (resolved 2026-03-28):
auto-ruff-format.shandcheck-ruff-before-commit.shexist in claude-custom. This ticket standardizes the repo-side config they depend on.Repos in scope (6)
Decomposition (4 workstreams)
Per review-55-2026-03-28, this umbrella decomposes into:
ruff check+ruff format --checksteps. Can be batched with remediation.File Targets (per repo)
pyproject.toml— ruff config section (line-length=88, select=["E","F","I","W"]).pre-commit-config.yaml— ruff pre-commit hook.woodpecker.yaml— ruff check step in CI (if not already present)Acceptance Criteria
Test Expectations
ruff check .passes cleanruff format --check .passes cleanpre-commit run --all-filespassesConstraints
Checklist
Related
forgejo_admin/claude-custom— existing ruff hooksservice-onboarding-sop— needs ruff sectionreview-55-2026-03-28— scope review with 8-repo auditScope Review: NEEDS_REFINEMENT
Review note:
review-55-2026-03-27Ticket is well-structured but too large for a single agent pass and missing traceability labels. Key findings:
story:Xorarch:Xlabels on board item #55### Typeheader in issue bodyauto-ruff-format.shandcheck-ruff-before-commit.share already registered — issue scope needs updatingRecommend decomposition via
template-boardbefore moving to next_up.Scope Review: NEEDS_REFINEMENT
Review note:
review-55-2026-03-27Ticket is well-structured but too large for a single agent pass and missing traceability labels. Key findings:
story:Xandarch:Xlabels on board item #55.pre-commit-config.yaml(only pal-e-docs has it). All 7 have[tool.ruff]in pyproject.toml already.claude-custom/hooks/check-ruff-before-commit.shandauto-ruff-format.shalready enforce ruff at agent commit timeRecommend decomposition via template-board into: (1) convention note, (2) SOP update, (3) per-repo remediation tickets, (4) CI standardization.
Scope Review: NEEDS_REFINEMENT
Review note:
review-55-2026-03-28Third review — issue body unchanged since prior two reviews (2026-03-27). All prior findings confirmed against current codebase. Key issues:
story:Xandarch:Xlabels on board item #55[tool.ruff]in pyproject.toml, only pal-e-docs has.pre-commit-config.yaml, only 3/8 have.woodpecker.ymlwith ruff stepsauto-ruff-format.shandcheck-ruff-before-commit.shalready enforce ruff at agent commit time — issue scope needs updating3
[SCOPE]decisions needed from Lucas before refinement can proceed.Scope Review: READY
Review note:
review-55-2026-03-28-r4Fourth review (re-review after major body rewrite). All 3 prior NEEDS_REFINEMENT findings resolved: scope decisions locked (line-length=88, E/F/I/W, archives excluded), traceability labels added, 4-workstream decomposition defined, 6-repo scope table with file targets included.
Key finding: All 6 repos already have CI ruff steps — workstream 3 (CI standardization) is a no-op. Remaining work is config alignment (line-length → 88) + adding .pre-commit-config.yaml to 5 repos.
Non-blocking nits: