diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bbf844af..efced516 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,8 +21,6 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - ref: ${{ github.head_ref }} # get current branch name - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: '3.x' @@ -89,8 +87,6 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v6.0.1 - with: - ref: ${{ github.head_ref }} # get current branch name - uses: actions/setup-python@v6.1.0 with: python-version: "3.10" diff --git a/commit_check/engine.py b/commit_check/engine.py index 4a76e0e7..aaf1ea60 100644 --- a/commit_check/engine.py +++ b/commit_check/engine.py @@ -522,7 +522,7 @@ class ValidationEngine: VALIDATOR_MAP: Dict[str, Type[BaseValidator]] = { "message": CommitMessageValidator, "subject_capitalized": SubjectCapitalizationValidator, - "imperative": SubjectImperativeValidator, + "subject_imperative": SubjectImperativeValidator, "subject_max_length": SubjectLengthValidator, "subject_min_length": SubjectLengthValidator, "author_name": AuthorValidator, diff --git a/commit_check/main.py b/commit_check/main.py index c473a3ad..d1e46738 100644 --- a/commit_check/main.py +++ b/commit_check/main.py @@ -151,7 +151,7 @@ def main() -> int: requested_checks.extend( [ "message", - "imperative", + "subject_imperative", "subject_max_length", "subject_min_length", "require_signed_off_by", diff --git a/commit_check/rules_catalog.py b/commit_check/rules_catalog.py index d48d366a..e291915a 100644 --- a/commit_check/rules_catalog.py +++ b/commit_check/rules_catalog.py @@ -27,7 +27,7 @@ class RuleCatalogEntry: suggest="Capitalize the first word of the subject", ), RuleCatalogEntry( - check="imperative", + check="subject_imperative", regex=None, error="Commit message should use imperative mood (e.g., 'Add feature' not 'Added feature')", suggest="Use imperative mood in the subject line", diff --git a/tests/engine_comprehensive_test.py b/tests/engine_comprehensive_test.py index 8ce16da3..b01a8951 100644 --- a/tests/engine_comprehensive_test.py +++ b/tests/engine_comprehensive_test.py @@ -157,7 +157,7 @@ class TestSubjectImperativeValidator: def test_subject_imperative_pass(self): """Test SubjectImperativeValidator pass case.""" rule = ValidationRule( - check="imperative", + check="subject_imperative", regex="", error="Subject must be imperative", suggest="Use imperative mood", @@ -173,7 +173,7 @@ def test_subject_imperative_pass(self): def test_subject_imperative_fail(self): """Test SubjectImperativeValidator fail case.""" rule = ValidationRule( - check="imperative", + check="subject_imperative", regex="", error="Subject must be imperative", suggest="Use imperative mood", @@ -247,7 +247,7 @@ def test_validation_engine_validator_map(self): expected_mappings = { "message": CommitMessageValidator, "subject_capitalized": SubjectCapitalizationValidator, - "imperative": SubjectImperativeValidator, + "subject_imperative": SubjectImperativeValidator, "subject_max_length": SubjectLengthValidator, "subject_min_length": SubjectLengthValidator, "author_name": AuthorValidator, diff --git a/tests/engine_test.py b/tests/engine_test.py index 81e714c6..416b5785 100644 --- a/tests/engine_test.py +++ b/tests/engine_test.py @@ -870,7 +870,7 @@ class TestSubjectImperativeValidator: @pytest.mark.benchmark def test_validate_with_imperative_subject(self): """Test validation with proper imperative subject.""" - rule = ValidationRule(check="imperative") + rule = ValidationRule(check="subject_imperative") validator = SubjectImperativeValidator(rule) context = ValidationContext(stdin_text="fix: resolve the issue") @@ -880,7 +880,7 @@ def test_validate_with_imperative_subject(self): @pytest.mark.benchmark def test_validate_with_non_imperative_subject(self): """Test validation with non-imperative subject.""" - rule = ValidationRule(check="imperative") + rule = ValidationRule(check="subject_imperative") validator = SubjectImperativeValidator(rule) context = ValidationContext(stdin_text="fix: resolved the issue") @@ -892,7 +892,7 @@ def test_validate_with_non_imperative_subject(self): @pytest.mark.benchmark def test_validate_short_subject(self): """Test validation with very short subject (edge case).""" - rule = ValidationRule(check="imperative") + rule = ValidationRule(check="subject_imperative") validator = SubjectImperativeValidator(rule) context = ValidationContext(stdin_text="feat: add") @@ -903,7 +903,7 @@ def test_validate_short_subject(self): @pytest.mark.benchmark def test_validate_with_breaking_change(self): """Test validation with breaking change notation.""" - rule = ValidationRule(check="imperative") + rule = ValidationRule(check="subject_imperative") validator = SubjectImperativeValidator(rule) context = ValidationContext(stdin_text="feat!: update authentication system") @@ -914,7 +914,7 @@ def test_validate_with_breaking_change(self): @pytest.mark.benchmark def test_validate_with_scoped_breaking_change(self): """Test validation with scoped breaking change notation.""" - rule = ValidationRule(check="imperative") + rule = ValidationRule(check="subject_imperative") validator = SubjectImperativeValidator(rule) context = ValidationContext(stdin_text="fix(auth)!: resolve login bug")