GRM-58: fix: enforce commit message convention on master with CI validation

This commit is contained in:
2026-06-22 10:12:01 +00:00
parent 3ae263fb00
commit 7d3cf999d6
6 changed files with 49 additions and 6 deletions
+23
View File
@@ -128,6 +128,29 @@ class TestMain:
result = runner.invoke(main, [])
assert result.exit_code == 2
def test_branch_override_accepts_master_commit(self) -> None:
"""--branch master overrides branch detection (for CI use)."""
msg_path = self._write_msg("GRM-19: feat: add feature")
runner = CliRunner()
result = runner.invoke(main, [msg_path, "--branch", "master"])
assert result.exit_code == 0
def test_branch_override_rejects_missing_task_id(self) -> None:
"""--branch master still enforces GRM-N: prefix."""
msg_path = self._write_msg("feat: add feature")
runner = CliRunner()
result = runner.invoke(main, [msg_path, "--branch", "master"])
assert result.exit_code == 1
assert "task ID" in result.output
def test_branch_override_feature_accepts_conventional(self) -> None:
"""--branch feature still rejects GRM-N prefix."""
msg_path = self._write_msg("GRM-19: feat: add feature")
runner = CliRunner()
result = runner.invoke(main, [msg_path, "--branch", "feature"])
assert result.exit_code == 1
assert "task ID" in result.output
def test_main_module_block() -> None:
import tempfile