Add todo app git hooks
Some checks failed
md-naming / markdown naming convention (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
repo-contract / repo contract (push) Has been cancelled
runnability / runnability (push) Has been cancelled

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

View File

@ -21,6 +21,7 @@ default_language_version:
default_stages: [pre-commit] default_stages: [pre-commit]
fail_fast: false fail_fast: false
default_install_hook_types: [pre-commit, pre-push, post-commit, post-merge, post-rewrite]
repos: repos:
# Landed 2026-08-29, the day the archive first reached zero ruff findings # Landed 2026-08-29, the day the archive first reached zero ruff findings
# repo-wide. Pinned exactly, per rules/dependency-freshness: 0.16.5 is the # repo-wide. Pinned exactly, per rules/dependency-freshness: 0.16.5 is the
@ -97,6 +98,30 @@ repos:
language: system language: system
files: \.(md|markdown)$ 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
# CLAUDE.md has always said a hook rejects these. Now one does. # CLAUDE.md has always said a hook rejects these. Now one does.
- id: no-suppressions - id: no-suppressions
name: no noqa or type-ignore comments name: no noqa or type-ignore comments

12
scripts/todo_hooks.sh Executable file
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 "$@"