Skip to content

feat(subject): add --require-subject-pattern for regex enforcement#74

Merged
benner merged 1 commit into
mainfrom
feat/require-subject-pattern
May 1, 2026
Merged

feat(subject): add --require-subject-pattern for regex enforcement#74
benner merged 1 commit into
mainfrom
feat/require-subject-pattern

Conversation

@benner
Copy link
Copy Markdown
Owner

@benner benner commented May 1, 2026

Teams need traceability from commits to tickets — a generic regex check
covers Jira keys, GitHub issue refs, and any custom convention without
hard-coding a specific format.

Add --require-subject-pattern REGEX (CLI), require-subject-pattern (config),
and require-subject-pattern (action.yml input). Regex is compiled at startup;
an invalid pattern causes exit 2 immediately. The check runs independently
of --enable/--disable. Tests cover match, no-match, invalid regex (exit 2),
and config-file resolution. Docs updated in README and the site.

Teams need traceability from commits to tickets — a generic regex check
covers Jira keys, GitHub issue refs, and any custom convention without
hard-coding a specific format.

Add --require-subject-pattern REGEX (CLI), require-subject-pattern (config),
and require-subject-pattern (action.yml input). Regex is compiled at startup;
an invalid pattern causes exit 2 immediately. The check runs independently
of --enable/--disable. Tests cover match, no-match, invalid regex (exit 2),
and config-file resolution. Docs updated in README and the site.

Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@gmail.com>
@benner benner marked this pull request as ready for review May 1, 2026 05:59
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Coverage

Coverage Report (Δ +0.0%)
FileStmtsMissCoverMissing
src/git_commit_guard
   __init__.py3810100% 
TOTAL3810100% 

@benner benner merged commit 0bae73f into main May 1, 2026
6 checks passed
@benner benner deleted the feat/require-subject-pattern branch May 1, 2026 06:01
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