Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions commit_check/imperatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"authenticate",
"authorize",
"auto",
"backport",
"batch",
"bind",
"block",
Expand All @@ -44,6 +45,7 @@
"close",
"collect",
"combine",
"comment",
"commit",
"compare",
"compose",
Expand Down Expand Up @@ -231,6 +233,7 @@
"pipe",
"plot",
"poll",
"polyfill",
"populate",
"post",
"prefix",
Expand Down Expand Up @@ -295,6 +298,7 @@
"retry",
"return",
"reuse",
"revamp",
"revert",
"revoke",
"rework",
Expand Down Expand Up @@ -385,6 +389,7 @@
"upload",
"use",
"validate",
"vendor",
"verify",
"view",
"wait",
Expand Down
22 changes: 22 additions & 0 deletions tests/engine_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,28 @@ def test_validate_empty_subject_passes(
class TestSubjectImperativeValidator:
"""Test SubjectImperativeValidator edge cases."""

@pytest.mark.benchmark
@pytest.mark.parametrize(
"subject",
[
"fix: backport the patch",
"chore: comment out the entry",
"docs: embed the example",
"build: polyfill the API",
"docs: revamp the profile",
"chore: vendor the dependency",
],
)
def test_validate_with_common_imperative_subjects(self, subject):
"""Common imperative verbs pass subject validation."""
rule = ValidationRule(check="subject_imperative")
validator = SubjectImperativeValidator(rule)
context = ValidationContext(stdin_text=subject)

result = validator.validate(context)

assert result == ValidationResult.PASS

@pytest.mark.benchmark
def test_validate_with_imperative_subject(self):
"""Test validation with proper imperative subject."""
Expand Down