mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-10 22:07:15 +01:00
Python 3.14 stdlib package wiring git to the todo MCP server: - closer (post-commit): runs the done_check of each Todo: trailer task and close_task's it only on exit 0. It FAILS OPEN: the commit already happened, so a down server, bad token or no gh prints one warning and exits 0 instead of failing the hook. - sweep: nightly drift report (systemd units shipped, not enabled). - import-pr: a merged PR's '## Todo:' items become tasks, deduped. - A done_check runs only if its sha256 is in ~/.config/todo-hooks/trusted-checks; 'Check: manual' notes are never auto-closed. - Hooks exposed in .pre-commit-hooks.yaml (post-commit, post-merge, post-rewrite). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
645 B
Bash
Executable File
17 lines
645 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# ============================================================================
|
|
# Run one todo_hooks subcommand (closer | sweep | trust | import-pr) from this
|
|
# utils checkout. This is the entry the .pre-commit-hooks.yaml hooks and the
|
|
# todo-drift systemd unit call, so a consuming repo needs no install step.
|
|
#
|
|
# Usage: scripts/todo_hooks.sh <subcommand> [args...]
|
|
# ============================================================================
|
|
|
|
set -euo pipefail
|
|
|
|
UTILS_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
readonly UTILS_ROOT
|
|
|
|
PYTHONPATH="$UTILS_ROOT${PYTHONPATH:+:$PYTHONPATH}" exec python3 -m todo_hooks "$@"
|