← 输入框|github.com|刷新
Skip to content

ci: pre-commit autoupdate - #123

Merged
shenxianpeng merged 1 commit into
mainfrom
pre-commit-ci-update-config
Nov 27, 2023
Merged

shenxianpeng merged 1 commit into
mainfrom
pre-commit-ci-update-config

Conversation

@pre-commit-ci

@pre-commit-ci pre-commit-ci Bot commented Nov 27, 2023

Copy link
Copy Markdown
Contributor

updates:
- [github.com/pre-commit/mirrors-mypy: v1.7.0 → v1.7.1](pre-commit/mirrors-mypy@v1.7.0...v1.7.1)
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@shenxianpeng
shenxianpeng merged commit 4b762aa into main Nov 27, 2023
@shenxianpeng
shenxianpeng deleted the pre-commit-ci-update-config branch November 27, 2023 21:18
shenxianpeng added a commit that referenced this pull request Jun 13, 2026
Add a `message_pattern` field to the `[commit]` config section that
allows users to provide a custom regex for commit message validation.
When set (non-empty), it takes precedence over the auto-generated
Conventional Commits regex.

This restores the custom-regex capability that was available in v1.x
(YAML config) and was lost in the v2.0 TOML rewrite.  It enables teams
to enforce custom formats such as:

- JIRA smart commits (`PROJ-123: description`)
- GitHub issue references (`Fix login #123`)
- Any other organization-specific message policy

Changes:
- rule_builder.py: check message_pattern before falling back to
  conventional_commits logic
- config_merger.py: add message_pattern to defaults, CLI arg mapping,
  and env var mapping (placed adjacent to conventional_commits)
- main.py: add --message-pattern CLI argument
- docs/configuration.rst: document the new option in example,
  mapping table, and options table (placed next to conventional_commits)
- docs/migration.rst: add section explaining how v1.x custom regex
  users can migrate to message_pattern
- tests: add 5 new tests covering precedence, override, fallback,
  JIRA format, and GitHub issue format

Closes #426
shenxianpeng added a commit that referenced this pull request Jun 29, 2026
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
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.

1 participant