Skip to content

Allowed more "ref" lines in commit messages#28261

Open
EvanHahn wants to merge 3 commits into
mainfrom
update-commit-ref-check
Open

Allowed more "ref" lines in commit messages#28261
EvanHahn wants to merge 3 commits into
mainfrom
update-commit-ref-check

Conversation

@EvanHahn
Copy link
Copy Markdown
Contributor

no ref

This change should have no user impact. It just quiets a development-only warning.

Before this change, our pre-commit hook showed a warning unless your commit's third line started with "ref", "fixes", or "closes".

Now it supports a wide array of options. These are lifted from some our internal document, "How to write commit messages".

no ref

This change should have no user impact. It just quiets a
development-only warning.

Before this change, our pre-commit hook showed a warning unless your
commit's third line started with "ref", "fixes", or "closes".

Now it supports a wide array of options. These are lifted from some
our internal document, "How to write commit messages".
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 64c979df-47dc-415f-8c38-bbe01ebe74cc

📥 Commits

Reviewing files that changed from the base of the PR and between f1a082b and fd98a32.

📒 Files selected for processing (1)
  • .github/hooks/commit-msg.bash
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/hooks/commit-msg.bash

Walkthrough

This PR updates the commit-msg validation hook to accept a broader set of issue-link keywords on the third line of commit messages. The validation regex is expanded to recognize ref, close, fixes, related to, contributes to, and no ref notations instead of a limited set. The error message and validation warning text are updated to reflect this wider keyword support.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change—expanding the set of allowed 'ref' keywords in the commit-msg hook validation.
Description check ✅ Passed The description clearly explains the purpose of the change, its scope, and impact, directly relating to the commit-msg hook modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-commit-ref-check

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/hooks/commit-msg.bash:
- Around line 70-71: The regex used to validate third_line incorrectly contains
"closing\ fix" which only matches the literal phrase "closing fix" and misses
valid forms like "closing ..." or standalone "closing"; update the pattern in
the if-condition that inspects the variable third_line to replace the "closing\
fix" token with "closing" (or include both "closing" and "fix" variants) so the
alternation correctly matches phrases starting with "closing" as well as other
keywords (the change should be made in the regex inside the if that tests
"$third_line" in .github/hooks/commit-msg.bash).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 712c0868-4288-47a5-8ed7-b769bc6aed63

📥 Commits

Reviewing files that changed from the base of the PR and between 9f1a6c6 and f1a082b.

📒 Files selected for processing (1)
  • .github/hooks/commit-msg.bash

Comment thread .github/hooks/commit-msg.bash Outdated
@EvanHahn EvanHahn requested a review from troyciesco May 30, 2026 20:36
@EvanHahn EvanHahn added the ok to merge for me You can merge this on my behalf if you want. label Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok to merge for me You can merge this on my behalf if you want.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants