Add ruff auto-format PreToolUse hook for git commits #79
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
ldraney/claude-custom#79
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?
Lineage
plan-pal-e-platform→ Phase 6 (CI Hardening) — prerequisite fixRepo
forgejo_admin/claude-customUser Story
As a platform operator
I want Python files auto-formatted before every git commit
So that CI never fails on
ruff format --checkagainContext
Ruff formatting failures are the #1 cause of CI failures platform-wide. Dev agents write Python code but don't run
ruff formatbefore committing. The CI test step runsruff format --check .and fails, blocking image builds. With Woodpecker logs broken, we can't even see the failure — we just get silent deploy failures.This has caused manual build+push workarounds for the last 25+ pipelines across multiple repos.
File Targets
Files to create:
hooks/auto-ruff-format.sh— PreToolUse hook that auto-formats staged .py files before git commitFiles to modify:
settings.json— register the new hook under PreToolUse → Bash matcherAcceptance Criteria
git commitin Bash commandsruff formaton staged .py files (skips gracefully if ruff not found)cdin commands, like block-main-commits.sh)Test Expectations
Constraints
Checklist
Closes #21in PR bodyRelated
pal-e-platform— CI failures caused by unformatted Pythonpal-e-agency— agent operating system improvement