-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
29 lines (27 loc) · 1.22 KB
/
.pre-commit-config.yaml
File metadata and controls
29 lines (27 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
repos:
- repo: local
hooks:
# Prevent commits with AI attribution
- id: check-commit-message
name: Check commit message for AI attribution
entry: |
bash -c 'msg=$(cat "$1"); if echo "$msg" | grep -qE "(Claude Code|Co-Authored-By:)"; then echo "❌ Commit rejected: Cannot include Claude Code attribution or Co-Authored-By trailers"; echo ""; echo "Per project conventions (.claude/CLAUDE.md), commit messages must not"; echo "include AI tool attribution or Co-Authored-By trailers."; echo ""; echo "Please edit your commit message and try again."; exit 1; fi'
language: system
stages: [commit-msg]
pass_filenames: true
# Run fixers automatically before each commit
- id: poe-fix
name: Run Poe 'fix'
entry: |
bash -c 'export PATH="$HOME/.local/bin:$PATH"; poetry run poe fix'
language: system
pass_filenames: false
stages: [pre-commit]
# Run checks (no auto-fixing) before pushing
- id: poe-check
name: Run Poe 'check'
entry: |
bash -c 'export PATH="$HOME/.local/bin:$PATH"; poetry run poe check'
language: system
pass_filenames: false
stages: [pre-push]