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
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,6 @@ Config precedence is:

| Directory | Link |
|---|---|
| **Official MCP Registry** | [`io.github.commit-check/commit-check-mcp`](https://registry.modelcontextprotocol.io/) |
| **Official MCP Registry** | [`io.github.commit-check/commit-check-mcp`](https://registry.modelcontextprotocol.io/?q=commit-check-mcp) |
| **Glama.ai** | [`github/commit-check/commit-check-mcp`](https://glama.ai/mcp/servers/github/commit-check/commit-check-mcp) |
| **PyPI** | [`commit-check-mcp`](https://pypi.org/project/commit-check-mcp/) |

To also add this server to your preferred directory, open a pull request at:

- [punkpeye/awesome-mcp-servers](https://github.com/punkpeye/awesome-mcp-servers) — community-maintained list
- [Smithery.ai](https://smithery.ai/) — hosted MCP server registry
36 changes: 36 additions & 0 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,42 @@ def test_failing_message_due_to_subject_case(self) -> None:
)
assert result["status"] == "fail"

def test_message_pattern_overrides_conventional_commits(self) -> None:
"""When message_pattern is set via config, it takes precedence."""
result = server._validate_message(
"PROJ-123: add new feature",
config={
"commit": {
"message_pattern": r"^PROJ-\d+: .+",
"conventional_commits": False,
"allow_merge_commits": True,
"allow_revert_commits": True,
"allow_empty_commits": True,
"allow_fixup_commits": True,
"allow_wip_commits": True,
}
},
)
assert result["status"] == "pass"

def test_message_pattern_fails_on_mismatch(self) -> None:
"""A message that doesn't match message_pattern should fail."""
result = server._validate_message(
"fix: some random change",
config={
"commit": {
"message_pattern": r"^PROJ-\d+: .+",
"conventional_commits": False,
"allow_merge_commits": True,
"allow_revert_commits": True,
"allow_empty_commits": True,
"allow_fixup_commits": True,
"allow_wip_commits": True,
}
},
)
assert result["status"] == "fail"


# ---------------------------------------------------------------------------
# _validate_branch (real engine call)
Expand Down