commit-msg hook: require an issue reference, not a close #121

Open
opened 2026-05-31 06:47:57 +00:00 by coilysiren · 0 comments
Owner

commit-msg hook: require an issue reference, not a close

check_commit_closes_issue.py (the commit-msg hook, canonical here and rolled out to every coilysiren/* repo) required a closing keyword (close/fixes/resolves) in front of the Forgejo issue URL. Kai asked to relax this: every commit must reference an issue, not necessarily close it.

Change

  • Made the closing keyword optional in URL_RE — a bare same-repo Forgejo issue URL now satisfies the rule.
  • Reworded the docstring, ERROR_NO_REF, the pre-commit hook display name, and docs/skill-discipline/handbook.md from "close" to "reference".
  • Added tests test_url_without_keyword_accepted and test_inline_url_reference_accepted.
  • The URL-only safety property is unchanged: bare #N / owner/repo#N with a keyword are still rejected (GitHub auto-close risk on mirrored repos), and cross-repo Forgejo URLs are still rejected.

Follow-up (loosen to fire only on commits merging into main) tracked separately at coilysiren/inbox#4.

## commit-msg hook: require an issue *reference*, not a *close* `check_commit_closes_issue.py` (the `commit-msg` hook, canonical here and rolled out to every `coilysiren/*` repo) required a closing keyword (`close`/`fixes`/`resolves`) in front of the Forgejo issue URL. Kai asked to relax this: every commit must **reference** an issue, not necessarily close it. ### Change - Made the closing keyword **optional** in `URL_RE` — a bare same-repo Forgejo issue URL now satisfies the rule. - Reworded the docstring, `ERROR_NO_REF`, the pre-commit hook display name, and `docs/skill-discipline/handbook.md` from "close" to "reference". - Added tests `test_url_without_keyword_accepted` and `test_inline_url_reference_accepted`. - The URL-only safety property is unchanged: bare `#N` / `owner/repo#N` with a keyword are still rejected (GitHub auto-close risk on mirrored repos), and cross-repo Forgejo URLs are still rejected. Follow-up (loosen to fire only on commits merging into main) tracked separately at coilysiren/inbox#4.
Sign in to join this conversation.
No labels
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/agentic-os#121
No description provided.