diff --git a/docs/changelog.rst b/docs/changelog.rst index b6c5592f..db8da8b3 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,3 +1,5 @@ +:status: new + Changelog ========= diff --git a/docs/configuration.rst b/docs/configuration.rst index 7353121d..842de4f5 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1,3 +1,5 @@ +:status: new + Configuration ============= @@ -18,6 +20,7 @@ Example Configuration --------------------- .. code-block:: toml + :class: copy [commit] # https://www.conventionalcommits.org diff --git a/docs/migration.rst b/docs/migration.rst index 4be7147e..b91d50a0 100644 --- a/docs/migration.rst +++ b/docs/migration.rst @@ -1,3 +1,5 @@ +:status: new + Migration Guide =============== diff --git a/docs/what-is-new.rst b/docs/what-is-new.rst index 7b14eb7d..893a345f 100644 --- a/docs/what-is-new.rst +++ b/docs/what-is-new.rst @@ -1,3 +1,5 @@ +:status: new + What's New ========== diff --git a/tests/engine_test.py b/tests/engine_test.py index 81ed364e..c88e4946 100644 --- a/tests/engine_test.py +++ b/tests/engine_test.py @@ -94,8 +94,15 @@ def test_commit_message_validator_with_file(self): finally: os.unlink(f.name) - def test_commit_message_validator_file_not_found(self): + @patch("commit_check.engine.get_commit_info") + def test_commit_message_validator_file_not_found(self, mock_get_commit_info): """Test CommitMessageValidator with non-existent file.""" + # Mock git fallback to return a message that doesn't match regex + mock_get_commit_info.side_effect = lambda format_str: { + "s": "invalid commit message", + "b": "", + }[format_str] + rule = ValidationRule(check="message", regex=r"^feat:") validator = CommitMessageValidator(rule) context = ValidationContext(commit_file="/nonexistent/file") @@ -123,7 +130,7 @@ def test_commit_message_validator_from_git(self, mock_get_commit_info): class TestBranchValidator: - @patch("commit_check.util.get_branch_name") + @patch("commit_check.engine.get_branch_name") def test_branch_validator_valid_branch(self, mock_get_branch_name): """Test BranchValidator with valid branch name.""" mock_get_branch_name.return_value = "feature/new-feature"