Skip to content

The Husky Pre-Commit Snippet Sets No INT or TERM Trap That CODESTYLE.md Interrupts Requires #4123

Closed

Description

@ptr727

Finding

catalog/snippets/husky/pre-commit starts child processes (dotnet husky run, then xargs running uv run ... prose_lint.py through hub_fetch_run.py, then repo_gate.py), but it sets no INT or TERM trap. CODESTYLE.md "Interrupts" and "Interrupts in Shell" (hub #4078) now require every Bash or shell script to stop its children and exit 130 or 143 on SIGINT or SIGTERM, printing one line naming the signal. The rule applies "when it is created or next edited", and the snippet is what every fleet repository copies on its next resync.

GitHub Copilot raised it on ptr727/LanguageTags#504 against .husky/pre-commit. From the hook header on, that file is this snippet byte for byte at hub 009d3e5e. So the fix belongs here, and the carrier takes it on its next resync. #4108 tracks the same rule for hub_fetch_run.py, the child this hook starts.

Expected

Either the snippet carries the INT/TERM traps "Interrupts in Shell" describes, adapted to POSIX sh since the hook is not Bash, or CODESTYLE.md states that a Git hook is exempt and why. One reason could be that Git delivers the signal to the whole foreground process group, so the children end with it.

Actual

The snippet has no traps, and nothing exempts it from the rule.

Activity

  1. ptr727 commented on Nov 13, 2026

    @ptr727
    OwnerAuthor

    Backlog burndown claim, round 2 (2026-11-13), away run, scope develop. Branch burndown/hook-chain-gate, group: #4131, #4135, #4123, #4108. Tier: frontier (carried hook snippets and helper, the prose gate, entangled across one hook chain).

    Predicted files:

    • .github/actions/prose-gate/prose_lint.py
    • .github/actions/prose-gate/prose-gate.json
    • scripts/prose_lint.py
    • tests/test_prose_lint.py
    • catalog/snippets/pre-commit/.pre-commit-config.yaml
    • catalog/snippets/pre-commit/README.md
    • catalog/snippets/husky/pre-commit
    • catalog/snippets/husky/README.md
    • .husky/pre-commit
    • .husky/pre-push
    • catalog/snippets/hub_fetch_run.py
    • tests/test_hub_fetch_run.py
    • tests/test_pre_commit_hook.py
    • scripts/README.md
    • GOVERNANCE.md ("Running the Linters Locally (Known-Working Invocations)", the hook's diff-base sentence)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions