From 6387e6819f20414e6f566d2f341d72e2f00e3913 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Mon, 2 Nov 2026 13:55:18 +0100 Subject: [PATCH] Add todo app git hooks Co-Authored-By: Claude Opus 5.5 (1M context) --- .pre-commit-config.yaml | 25 +++++++++++++++++++++++++ scripts/todo_hooks.sh | 12 ++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 scripts/todo_hooks.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7f0fc78..35cfe9f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,6 +8,7 @@ default_language_version: default_stages: [pre-commit] fail_fast: false +default_install_hook_types: [pre-commit, pre-push, post-commit, post-merge, post-rewrite] repos: # =========================================================================== # GENERAL HOOKS @@ -218,6 +219,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 + # Every dependency on its ecosystem's newest STABLE release, exact-pinned # so the question is mechanically answerable at all. # diff --git a/scripts/todo_hooks.sh b/scripts/todo_hooks.sh new file mode 100755 index 0000000..168dc7b --- /dev/null +++ b/scripts/todo_hooks.sh @@ -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 "$@"