Skip to content

fix: allow special characters in conventional commit description - #447

Merged
shenxianpeng merged 1 commit into
mainfrom
bugfix/conventional-commit-regex-special-chars
Jun 29, 2026
Merged

shenxianpeng merged 1 commit into
mainfrom
bugfix/conventional-commit-regex-special-chars

Conversation

@shenxianpeng

Copy link
Copy Markdown
Member

Summary

The conventional commit regex used ([\w ])+ for the description part, which only allowed word characters (letters, digits, underscore) and spaces. This caused false rejections for common special characters in commit descriptions.

Changes

Changed ([\w ])+ to [^\n]+ in _build_conventional_commit_regex() to allow any character except newline in the description, which aligns with the Conventional Commits specification where the subject is a single line.

Before (broken)

Commit Message Result
feat: fix bug #123 ❌ Rejected (# not in [\w ])
fix: use "double quotes" ❌ Rejected (" not in [\w ])
docs: update API/URL ❌ Rejected (/ not in [\w ])

After (fixed)

Commit Message Result
feat: fix bug #123 ✅ Accepted
fix: use "double quotes" ✅ Accepted
docs: update API/URL ✅ Accepted
feat: add feature ✅ Still works
feat(scope)!: breaking change ✅ Still works

Closes #6

Change the regex from ([\w ])+ to [^\n]+ for the description part
of the conventional commit message. The previous pattern only allowed
word characters and spaces, causing false rejections for common
special characters like #, ", /, (, ), @, etc.

Fixes issues like:
- feat: fix bug #123  → # was rejected
- fix: use "quotes"  → " was rejected
- docs: update API/URL → / was rejected
@shenxianpeng
shenxianpeng requested a review from a team as a code owner June 29, 2026 21:53
@netlify

netlify Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for commit-check ready!

Name Link
🔨 Latest commit 49efb23
🔍 Latest deploy log https://app.netlify.com/projects/commit-check/deploys/6a42e964b907270008cfc909
😎 Deploy Preview https://deploy-preview-447--commit-check.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the bug Something isn't working label Jun 29, 2026
@shenxianpeng
shenxianpeng merged commit 688a3b6 into main Jun 29, 2026
27 checks passed
@shenxianpeng
shenxianpeng deleted the bugfix/conventional-commit-regex-special-chars branch June 29, 2026 21:55
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.60%. Comparing base (271b9f9) to head (49efb23).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #447   +/-   ##
=======================================
  Coverage   96.60%   96.60%           
=======================================
  Files          10       10           
  Lines        1089     1089           
=======================================
  Hits         1052     1052           
  Misses         37       37           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

Next review available in: 10 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7b19d01e-8ab0-48f4-a74d-1819ae41a49a

📥 Commits

Reviewing files that changed from the base of the PR and between 271b9f9 and 49efb23.

📒 Files selected for processing (1)
  • commit_check/rule_builder.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/conventional-commit-regex-special-chars

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.

@codspeed

codspeed Bot commented Jun 29, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 312 untouched benchmarks
⏩ 109 skipped benchmarks1


Comparing bugfix/conventional-commit-regex-special-chars (49efb23) with main (271b9f9)

Open in CodSpeed

Footnotes

  1. 109 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

commit-check can run with GitHub Action

1 participant