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
4 changes: 0 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion commit_check/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion commit_check/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def main() -> int:
requested_checks.extend(
[
"message",
"imperative",
"subject_imperative",
"subject_max_length",
"subject_min_length",
"require_signed_off_by",
Expand Down
2 changes: 1 addition & 1 deletion commit_check/rules_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions tests/engine_comprehensive_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions tests/engine_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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")

Expand All @@ -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")

Expand All @@ -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")

Expand All @@ -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")

Expand Down
Loading