diff --git a/commit_check/imperatives.py b/commit_check/imperatives.py index 875273a5..3704ee79 100644 --- a/commit_check/imperatives.py +++ b/commit_check/imperatives.py @@ -25,6 +25,7 @@ "authenticate", "authorize", "auto", + "backport", "batch", "bind", "block", @@ -44,6 +45,7 @@ "close", "collect", "combine", + "comment", "commit", "compare", "compose", @@ -231,6 +233,7 @@ "pipe", "plot", "poll", + "polyfill", "populate", "post", "prefix", @@ -295,6 +298,7 @@ "retry", "return", "reuse", + "revamp", "revert", "revoke", "rework", @@ -385,6 +389,7 @@ "upload", "use", "validate", + "vendor", "verify", "view", "wait", diff --git a/tests/engine_test.py b/tests/engine_test.py index 65a239a9..f5b514e3 100644 --- a/tests/engine_test.py +++ b/tests/engine_test.py @@ -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."""