Add todo app git hooks

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Krzysztof Rudnicki 2026-11-02 13:55:44 +01:00
parent 4d9e845f32
commit 817447a09c
2 changed files with 37 additions and 0 deletions

View File

@ -3,6 +3,7 @@
# Created when the shared markdown-naming gate was rolled out. The checks
# are `language: system` because they are plain bash already on this
# machine; pre-commit must not build an isolated env for them.
default_install_hook_types: [pre-commit, post-commit, post-merge, post-rewrite]
repos:
- repo: local
hooks:
@ -16,6 +17,30 @@ repos:
language: system
files: \.(md|markdown)$
- id: todo-closer
name: close Todo trailer tasks
entry: scripts/todo_hooks.sh closer
language: system
stages: [post-commit]
always_run: true
pass_filenames: false
- id: todo-import-pr-merge
name: import PR Todo sections (pull)
entry: scripts/todo_hooks.sh import-pr post-merge
language: system
stages: [post-merge]
always_run: true
pass_filenames: false
- id: todo-import-pr-rewrite
name: import PR Todo sections (pull --rebase)
entry: scripts/todo_hooks.sh import-pr post-rewrite
language: system
stages: [post-rewrite]
always_run: true
pass_filenames: false
# Shared 250-line cap on every file in the commit, code and prose alike.
# Checks only what is staged, so an unrelated commit never goes red, and
# it fails rather than warns: no baseline, no allowlist.

View File

@ -0,0 +1,12 @@
#!/bin/bash
# Shim: forward to the shared todo git hooks in ~/src/utils (silent if absent).
set -euo pipefail
readonly SHARED="${UTILS_ROOT:-$HOME/src/utils}/scripts/todo_hooks.sh"
main() {
[[ -f "$SHARED" ]] || exit 0
exec bash "$SHARED" "$@"
}
main "$@"