Skip to content

Commit 837c88a

Browse files
authored
docs: the comparison table claims 24 rules, the package defines 22 (#35)
1 parent 42a5a9d commit 837c88a

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

‎docs/compare/tools.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ for the current state. GitHub's own rulesets are on
1616
| [commitcheck](https://github.com/marketplace/commitcheck) | A hosted App that applies one regular expression, set in its web admin | Commit message, pull request title or description, by regex | GitHub App | Free for public repositories; $25 a month for private ones |
1717
| [DCO app](https://github.com/apps/dco) and [DCO-2](https://github.com/cncf/dco2) | The sign-off check the Linux kernel and the CNCF use, with a remediation flow for missing sign-offs | `Signed-off-by` trailers | GitHub App | Free, open source |
1818
| [PRLint](https://github.com/ewolfe/prlint), [PR Title Checker](https://github.com/marketplace/actions/pr-title-checker) | Regular expressions over pull request fields | Title, body, labels, branch | App / Action | Free, open source |
19-
| **Commit Check** | One rule engine with [24 documented rules](../rules.md), run as a hook, a CLI, an Action, a hosted App or an MCP tool | Commit message, branch name, author name and email, sign-off, AI attribution, force pushes, file size and paths, tag names; the squash message of a pull request | All of the above | Free, open source; the App's private organization repositories move to a paid plan later |
19+
| **Commit Check** | One rule engine with [22 documented rules](../rules.md), run as a hook, a CLI, an Action, a hosted App or an MCP tool | Commit message, branch name, author name and email, sign-off, AI attribution, force pushes, file size and paths, tag names; the squash message of a pull request | All of the above | Free, open source; the App's private organization repositories move to a paid plan later |
2020

2121
## What is different about Commit Check
2222

‎tests/docs_sync_test.py‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,28 @@ def test_every_rule_explains_itself(self):
133133
f"{entry.rule_id} ({entry.check}) section is missing {required}"
134134
)
135135

136+
def test_prose_rule_counts_match_the_catalog(self):
137+
"""A page that counts the rules out loud must count them correctly.
138+
139+
The comparison table sells the engine on how much it covers, so a
140+
stale number there is worse than no number: it is the one figure a
141+
reader checks against the rules page. Every other test here proves a
142+
rule is *documented*; none of them read a sentence that says how
143+
many there are.
144+
"""
145+
expected = len(ALL_RULES)
146+
for path in sorted(DOCS.rglob("*.md")):
147+
if path.parent.name == "posts":
148+
continue # blog posts are dated records; see AGENTS.md
149+
for claimed in _PROSE_RULE_COUNT.findall(path.read_text(encoding="utf-8")):
150+
assert int(claimed) == expected, (
151+
f"{path.relative_to(DOCS.parent)} claims {claimed} rules, "
152+
f"but the package defines {expected}"
153+
)
154+
155+
156+
#: A prose claim about how many rules exist, e.g. ``24 documented rules``.
157+
_PROSE_RULE_COUNT = re.compile(r"(\d+) documented rules")
136158

137159
#: A pre-commit revision pin, e.g. ``rev: v2.13.1``.
138160
_REV_PIN = re.compile(r"^\s*rev:\s*v(\d+\.\d+\.\d+)\s*$", re.M)

0 commit comments

Comments
 (0)