chore(#114): enforce single Closes-keyword per PR body#125
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Caps distinct auto-closing references (
close(s/d)/fix(es/ed)/resolve(s/d)followed by#Norowner/repo#N) at one per PR body. Closes the loophole where the title validator already limited the title to a single ticket reference but a body withCloses #1 Closes #2 Closes #3would auto-close all three on merge, defeating the "one ticket per PR" rule.#Nreferenced twice (e.g. viaFixesandClosesto the same issue) is one.owner/repo#N) count normally..pr.allow_multiple_closes: truedisables for teams that batch rollbacks / dep bumps.<!-- multi-close: approved -->in the body prints a visible stderr WARN and lets that PR through. Grep-able trace.Changed files:
.claude/hooks/validate-pr-create.sh— new close-count check appended after the required-sections check landed in [Chore] Require Testing section in PR body (extend validate-pr-create.sh) #113. Shares the same_lib-read-config.shreader, same$BODY_CONTENTextraction path, same error-accumulator pattern..claude/hooks/tests/test_single_closes_per_pr.sh— 10 cases..claude/project-config.defaults.json— addedpr.allow_multiple_closes: falseandpr.multi_close_skip_marker.docs/rule-audit.md— existing "One ticket at a time" row flipped fromnotopartialwith the new footnote.Testing
This PR itself has exactly one closing keyword (
Closes #114at the bottom) — the now-live-on-branch check let it through.What a cross-ref looks like
Closing refs (these count):
Cross-refs (these DO NOT count — they're informational, not auto-close):
The distinction is the GitHub closing keyword — anything without one is cross-reference and safe.
Scope — what this does NOT do
Closes #Nis valid (the title still carries the ticket ref, and some PRs are QA-handed-off via theqalabel flow without auto-close).Follow-ups
<!-- multi-close: approved -->bypasses in the log, it's a signal thatallow_multiple_closes: truemight be the better config for their workflow.Glossary
close(s/d),fix(es/ed),resolve(s/d), case-insensitive.#Nmention without a closing keyword — informational only, doesn't auto-close anything.Closes #114