Skip to content

Add commit message check - #1

Merged
electrum merged 1 commit into
mainfrom
user/electrum/add-commit-message-check
Jul 29, 2026
Merged

Add commit message check#1
electrum merged 1 commit into
mainfrom
user/electrum/add-commit-message-check

Conversation

@electrum

Copy link
Copy Markdown
Member

Adds a reusable action that enforces commit title length, description
wrapping, and AI or coding tool attribution policy.

Projects can use a shared, centrally maintained commit-message policy.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7fa8da05-c573-486d-85d8-32141003315d

📥 Commits

Reviewing files that changed from the base of the PR and between 7232161 and fca689c.

📒 Files selected for processing (7)
  • .github/workflows/ci.yml
  • .gitignore
  • README.md
  • check-commit-messages/README.md
  • check-commit-messages/action.yml
  • check-commit-messages/check.py
  • check-commit-messages/test_check.py
📝 Walkthrough

Walkthrough

Adds a Python commit-message checker for subject length, description wrapping, and prohibited attribution trailers. Packages it as a composite GitHub Action, documents its policies and usage, adds unit tests, and integrates validation into a GitHub Actions CI workflow. Updates .gitignore for Python artifacts.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
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.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
check-commit-messages/check.py (1)

147-222: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate code-fence/blockquote tracking between get_description_violations and get_attribution_violations.

Both functions independently reimplement the same line-classification state machine (fence-toggle detection, in-code-block tracking, blockquote skip). Extracting a shared line iterator/helper would reduce duplication and the risk of the two implementations drifting apart as the policy evolves.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 409df84a-5862-434a-a3eb-844425ae2f76

📥 Commits

Reviewing files that changed from the base of the PR and between 9c4de9f and 5b27433.

📒 Files selected for processing (8)
  • .github/workflows/ci.yml
  • .gitignore
  • LICENSE
  • README.md
  • check-commit-messages/README.md
  • check-commit-messages/action.yml
  • check-commit-messages/check.py
  • check-commit-messages/test_check.py

Comment thread .github/workflows/ci.yml
Comment thread check-commit-messages/check.py
Comment thread check-commit-messages/README.md
@electrum
electrum force-pushed the user/electrum/add-commit-message-check branch 3 times, most recently from 23f7e69 to 7ac6f2f Compare July 28, 2026 21:22
@electrum
electrum marked this pull request as ready for review July 28, 2026 21:23
@electrum
electrum force-pushed the user/electrum/add-commit-message-check branch 2 times, most recently from 15b7623 to 0f42d17 Compare July 28, 2026 21:30
@electrum
electrum enabled auto-merge July 28, 2026 21:32
@electrum
electrum force-pushed the user/electrum/add-commit-message-check branch from 0f42d17 to 23e0bde Compare July 28, 2026 21:34
@electrum
electrum requested review from Copilot and dain July 28, 2026 21:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a reusable composite GitHub Action (plus implementation + CI) to enforce a shared commit-message policy across projects: commit subject length limits, description line wrapping rules, and restrictions on AI/coding-tool attribution trailers.

Changes:

  • Added check-commit-messages composite action that inspects PR commit messages via git and enforces subject/description/trailer rules.
  • Added a Python implementation (check.py) with unit tests validating wrapping exemptions and prohibited attribution markers.
  • Added repo documentation and CI workflow to run the unit tests and the action on pull requests.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
README.md Introduces the repo and links to the new commit-message check action.
check-commit-messages/action.yml Composite action entrypoint that validates base_ref and runs the checker.
check-commit-messages/check.py Core policy enforcement logic (subject length, wrapping checks, trailer attribution checks) and output formatting.
check-commit-messages/test_check.py Unit tests for subject length, wrapping exemptions, and attribution marker blocking.
check-commit-messages/README.md Documents policy and provides usage example for consumers.
.github/workflows/ci.yml Adds CI to run unit tests and execute the action on PRs.
.gitignore Ignores Python bytecode / cache files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread check-commit-messages/check.py
@electrum
electrum force-pushed the user/electrum/add-commit-message-check branch from 23e0bde to a88dee4 Compare July 28, 2026 21:42
@electrum
electrum disabled auto-merge July 29, 2026 02:11
@electrum
electrum added this pull request to the merge queue Jul 29, 2026
@electrum
electrum removed this pull request from the merge queue due to a manual request Jul 29, 2026
@electrum
electrum force-pushed the user/electrum/add-commit-message-check branch from a88dee4 to 7232161 Compare July 29, 2026 02:13
@electrum
electrum added this pull request to the merge queue Jul 29, 2026
@electrum
electrum removed this pull request from the merge queue due to a manual request Jul 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 37104103-aa1e-4b10-ba35-0e1fd55c5199

📥 Commits

Reviewing files that changed from the base of the PR and between 5b27433 and 7232161.

📒 Files selected for processing (7)
  • .github/workflows/ci.yml
  • .gitignore
  • README.md
  • check-commit-messages/README.md
  • check-commit-messages/action.yml
  • check-commit-messages/check.py
  • check-commit-messages/test_check.py
🚧 Files skipped from review as they are similar to previous changes (5)
  • .gitignore
  • .github/workflows/ci.yml
  • check-commit-messages/action.yml
  • check-commit-messages/README.md
  • check-commit-messages/test_check.py

Comment thread check-commit-messages/check.py
@electrum
electrum force-pushed the user/electrum/add-commit-message-check branch from 7232161 to fca689c Compare July 29, 2026 02:19
@electrum
electrum added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit 3cd4cf2 Jul 29, 2026
1 check passed
This was referenced Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants