Skip to content

chore: add pre-commit validation hook for PR template compliance - #1508

Merged
ashleyshaw merged 1 commit into
developfrom
chore/governance-precommit-validation
Aug 4, 2026
Merged

chore: add pre-commit validation hook for PR template compliance#1508
ashleyshaw merged 1 commit into
developfrom
chore/governance-precommit-validation

Conversation

@ashleyshaw

Copy link
Copy Markdown
Member

Linked issues

Relates to #1489

Summary

Adds pre-commit validation hook to enforce governance compliance before push. Validates branch naming, prevents direct commits to main/develop, and warns about missing PR template sections.

Changes

  • Add hooks/pr-checklist-validator.sh — executable pre-commit validation hook
  • Integrates with Claude Code UserPromptSubmit hook
  • Validates: branch naming ({type}/{scope}-{short-title}), forbidden prefixes (claude/), protected branches

Features

  • ✅ Branch name format validation
  • ✅ Protection for main/develop branches
  • ✅ Template warnings for feat/ branches
  • ✅ Real-time feedback in Claude Code or terminal
  • ✅ Portable hook (root-level, reusable)

Integration

Add to .claude/settings.json (local, not committed):

{
"hooks": {
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "hooks/pr-checklist-validator.sh",
"statusMessage": "Validating PR compliance checklist..."
}
]
}
]
}
}

Changelog

Added


Checklist (Global DoD / PR)

@coderabbitai

coderabbitaiBot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@ashleyshaw, you've reached your PR review limit, so we couldn't start this review.

Next review available in:40 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 289a34e3-392f-48ba-868a-2979fb096d99

📥 Commits

Reviewing files that changed from the base of the PR and between ed1b685 and f647bae.

📒 Files selected for processing (1)
  • hooks/pr-checklist-validator.sh

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.

@github-actions

Copy link
Copy Markdown
Contributor

⏱️ Aging and SLA annotation

  • Age: 0 day(s)
  • SLA state: Within SLA
  • Thresholds: warn at 7 days, breach at 14 days
  • Last updated: 2026-08-04T17:47:40.640Z

Maintained by project-meta-sync workflow.

@github-actionsgithub-actionsBot added status:needs-review Awaiting code review type:chore Chore / small hygiene change priority:normal Default priority area:scripts Scripts & tooling meta:needs-changelog Requires a changelog entry before merge labels Aug 4, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #1508

CI Status:success
Files changed: 1
Risk Distribution: 0 critical, 0 high, 0 medium, 1 low

Recommendations

  • Ready to proceed pending human review

@mergify

mergifyBot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Implements mandatory pre-commit checklist validation to prevent governance
violations BEFORE push. Validates:
- Branch naming ({type}/{scope}-{short-title}, no claude/ prefix)
- Prevents direct commits to main/develop
- For feat/ branches: warns about required template sections
Hook can be integrated with Claude Code UserPromptSubmit hook in
local .claude/settings.json (example provided in PR body).
Relates to #1489
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@ashleyshaw
ashleyshawforce-pushed the chore/governance-precommit-validation branch from 5600ad1 to f647baeCompareAugust 4, 2026 18:13
@ashleyshaw
ashleyshaw merged commit 2e3a5d0 into developAug 4, 2026
19 of 24 checks passed
@ashleyshaw
ashleyshaw deleted the chore/governance-precommit-validation branch August 4, 2026 18:15
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:scriptsScripts & toolingmeta:needs-changelogRequires a changelog entry before mergepriority:normalDefault prioritystatus:needs-reviewAwaiting code reviewtype:choreChore / small hygiene change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@ashleyshaw