Skip to content

Commit 4295029

Browse files
authored
docs: update sample output to v2.20.4 and add two changelog entries (#83)
**Before:** The site showed the failure output of v2.20.2 and earlier in 18 samples on six pages, the homepage included, and the changelog stopped at v2.20.2 while PyPI has v2.20.4. ```text CC001 message check failed ==> updated the parser The commit message should follow Conventional Commits. See https://www.conventionalcommits.org Suggest: Use <type>(<scope>): <description>, where <type> is one of: feat, fix, docs, ... Docs: https://commit-check.com/rules/#cc001 ``` **After:** Every sample outside the blog is what 2.20.4 prints, and the changelog has entries for v2.20.3 and v2.20.4 with a Highlights row for 2.20.3. ```text ✖ Commit rejected by Commit Check · 1 check failed ✖ CC001 message failed: updated the parser The commit message should follow Conventional Commits. See https://www.conventionalcommits.org Suggest: Use <type>(<scope>): <description>, where <type> is one of: feat, fix, docs, style, refactor, test, chore, perf, build, ci Docs: https://commit-check.com/rules/#cc001 ``` v2.20.3 replaced the ASCII banner with a one-line header and an indented block per failed check; this brings the site into step with it. ## How - **Samples.** Each one was run again with commit-check 2.20.4 (the two hook transcripts with pre-commit 4.7.0, `rev: v2.20.4`) and pasted as printed: `getting-started.md`, `example.md`, `troubleshoot.md`, `guides/policies.md` and the two at the top of `rules.md` show the whole output; the per-rule examples in `rules.md` stay three-line excerpts, as before. - **Homepage.** The hero terminal and the numbered breakdown follow the same transcript. The hero is one line taller (415px against 394px at desktop width). - **Wording.** `--no-banner` now hides a header, not ASCII art (`example.md`, `configuration.md`). The table in Getting started names the value without `==>`. - **Three short notes** for behaviour fixed in these releases, each where the rule is documented: trailers alone are not a body (CC011), the author read before a commit exists is `GIT_AUTHOR_*`, then `author.*`, then `user.*` (CC017 and Checking the committer), and CC017's advice for a message that is not committed yet. - **Changelog.** One sentence per change, each linked to its page and pull request. 2.20.4 only fixes bugs, so it gets no Highlights row. - **Test.** `_SAMPLE_FAILURE` in `tests/docs_sync_test.py` matched only the old `check failed ==>` line, so after this change it would have checked nothing. It now reads both forms. Breaking a rule name in a sample (`author-nam`) makes the test fail again. - **Blog posts are untouched.** They are dated records and keep the output of their day. ## Checks - `mkdocs build --strict` passes. - `python -m pytest tests/ -q`: 18 passed, against commit-check 2.20.4. - No horizontal overflow at 390px wide on the homepage and the six changed guide and reference pages. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Updated examples across the guides, rules, and troubleshooting pages to reflect the current structured failure and warning output. * Clarified how author identity is selected and that trailers alone do not satisfy the non-empty commit-body requirement. * Added changelog entries for versions 2.20.3 and 2.20.4. * **Tests** * Updated documentation checks to accept both legacy and current failure or warning output formats. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Xianpeng Shen <3353385+shenxianpeng@users.noreply.github.com>
1 parent 62054b3 commit 4295029

9 files changed

Lines changed: 142 additions & 82 deletions

File tree

‎docs/changelog.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ page that documents it.
1111

1212
| Version | What changed | Documented in |
1313
|---|---|---|
14+
| [2.20.3](#v2203) | Failures print a one-line header and an indented block per check, in place of the ASCII banner; an agent skill for coding agents | [Getting started](getting-started.md#2-watch-it-reject-something) · [With AI coding agents](guides/ai-agents.md#tell-the-agent) |
1415
| [2.20.1](#v2201) | `--ai-attribution-only` checks a pull request description against your AI policy; JSON lists the AI tools found; more AI marks recognised | [Checking a pull request description](guides/policies.md#checking-a-pull-request-description) · [CC013](rules.md#cc013) |
1516
| [2.20.0](#v2200) | Commits authored by an AI tool rejected; subject length `0` turns the rule off; Python 3.11+ required | [CC017](rules.md#cc017) · [CC013](rules.md#cc013) · [CC004](rules.md#cc004) |
1617
| [2.19.5](#v2195) | GitHub merge queue branches accepted by default; aider's default co-author trailer recognised; exit 2 when git cannot read the repository | [CC201](rules.md#cc201) · [CC013](rules.md#cc013) · [Exit codes](troubleshoot.md#exit-codes) |
@@ -38,6 +39,29 @@ page that documents it.
3839
| [2.5.0](#v250) | Organization-wide config with `inherit_from` | [Across an organization](guides/organization.md) |
3940
| [2.0.0](#v200) | Configuration moved from YAML to TOML — breaking | [Migrating from v1](migration.md) |
4041

42+
## v2.20.4 (2026-11-10) { #v2204 }
43+
44+
### Fixed
45+
46+
* `require_body` no longer takes trailers alone, such as the `Signed-off-by:` line from `git commit -s`, for a body. ([CC011](rules.md#cc011), [#689](https://github.com/commit-check/commit-check/pull/689))
47+
* `ignore_authors` written as one string is split on commas, instead of skipping any author whose name is part of it. ([Every option](configuration.md#every-option), [#689](https://github.com/commit-check/commit-check/pull/689))
48+
* `--author-name` and `--author-email` honour `git commit --author` and the `author.name` and `author.email` settings. ([Checking the committer](example.md#checking-the-committer), [#689](https://github.com/commit-check/commit-check/pull/689))
49+
50+
## v2.20.3 (2026-11-10) { #v2203 }
51+
52+
### Added
53+
54+
* An agent skill teaches coding agents to check a message before they commit. ([With AI coding agents](guides/ai-agents.md#tell-the-agent), [#679](https://github.com/commit-check/commit-check/pull/679), [#686](https://github.com/commit-check/commit-check/pull/686))
55+
56+
### Changed
57+
58+
* A failure prints a one-line header and an indented block per check, in place of the ASCII banner. ([Getting started](getting-started.md#2-watch-it-reject-something), [#682](https://github.com/commit-check/commit-check/pull/682))
59+
60+
### Fixed
61+
62+
* CC017 on a message that is not committed yet suggests setting your own `user.name` and `user.email`, not amending. ([CC017](rules.md#cc017), [#685](https://github.com/commit-check/commit-check/pull/685))
63+
* `--ai-attribution-only` with no text piped in passes, instead of judging `HEAD`. ([Guide](guides/policies.md#checking-a-pull-request-description), [#684](https://github.com/commit-check/commit-check/pull/684))
64+
4165
## v2.20.2 (2026-11-08) { #v2202 }
4266

4367
### Changed

‎docs/configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ conventional_branch = true
178178
```
179179

180180
A warned rule prints the same block as a failure with `warning` in place of
181-
`failed`, no rejection banner, and one closing line saying the run is not
181+
`failed`, no rejection header, and one closing line saying the run is not
182182
failed by it; with `--compact` it is one `[WARN]` line. A one-line notice on
183183
stderr names the warned rules, so a hook that exits `0` after red-looking
184184
output is not mistaken for a broken hook. The exit code counts only enforced

‎docs/example.md‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ revision.
5656

5757
```console
5858
$ echo "updated the parser" | commit-check -m
59-
CC001 message check failed ==> updated the parser
60-
The commit message should follow Conventional Commits. See https://www.conventionalcommits.org
61-
Suggest: Use <type>(<scope>): <description>, where <type> is one of: feat, fix, ...
62-
Docs: https://commit-check.com/rules/#cc001
59+
✖ Commit rejected by Commit Check · 1 check failed
60+
61+
✖ CC001 message failed: updated the parser
62+
The commit message should follow Conventional Commits. See https://www.conventionalcommits.org
63+
Suggest: Use <type>(<scope>): <description>, where <type> is one of: feat, fix, docs, style, refactor, test, chore, perf, build, ci
64+
Docs: https://commit-check.com/rules/#cc001
6365
```
6466

6567
Fix it and it goes quiet:
@@ -140,6 +142,9 @@ tighten them.
140142

141143
Without `--rev`, these validate the *local git config* — whoever is about to
142144
commit — falling back to `HEAD`'s author only when no identity is configured.
145+
The identity is read in git's order: `GIT_AUTHOR_NAME` and
146+
`GIT_AUTHOR_EMAIL` when set, then `author.name` and `author.email`, then
147+
`user.name` and `user.email`.
143148
That is the right subject for a hook and the wrong one for CI: an existing
144149
commit's identity is a fact about the commit, not about the operator running
145150
the check. Add `--rev` and both checks read that commit's recorded author, and
@@ -206,7 +211,7 @@ and how CLI, environment and file settings override each other.
206211

207212
=== "No banner"
208213

209-
Plain text without the ASCII art, which is noise in a CI log.
214+
Plain text without the one-line header that counts the failed checks.
210215

211216
```console
212217
$ commit-check -m --no-banner

‎docs/getting-started.md‎

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,21 @@ $ commit-check --message
6767
```
6868

6969
```text
70-
CC001 message check failed ==> updated the parser
71-
The commit message should follow Conventional Commits. See https://www.conventionalcommits.org
72-
Suggest: Use <type>(<scope>): <description>, where <type> is one of: feat, fix, docs, ...
73-
Docs: https://commit-check.com/rules/#cc001
70+
✖ Commit rejected by Commit Check · 1 check failed
71+
72+
✖ CC001 message failed: updated the parser
73+
The commit message should follow Conventional Commits. See https://www.conventionalcommits.org
74+
Suggest: Use <type>(<scope>): <description>, where <type> is one of: feat, fix, docs, style, refactor, test, chore, perf, build, ci
75+
Docs: https://commit-check.com/rules/#cc001
7476
```
7577

76-
Four things are happening in that output, and each is deliberate:
78+
The first line counts the failed checks. Each failure under it carries four
79+
things, and each is deliberate:
7780

7881
| Part | What it gives you |
7982
|---|---|
8083
| `CC001` | A stable rule ID. It will mean the same thing in five years. |
81-
| `==> updated the parser` | The exact value that failed, not just "invalid message". |
84+
| `updated the parser` | The exact value that failed, not just "invalid message". |
8285
| `Suggest:` | What to do about it. |
8386
| `Docs:` | Why the rule exists, and how to configure or disable it. |
8487

@@ -99,10 +102,12 @@ $ commit-check --branch
99102
```
100103

101104
```text
102-
CC201 branch check failed ==> my-changes
103-
The branch should follow Conventional Branch. See https://conventionalbranch.org
104-
Suggest: Use <type>/<description> with an allowed type, or add the branch to allow_branch_names in config
105-
Docs: https://commit-check.com/rules/#cc201
105+
✖ Branch rejected by Commit Check · 1 check failed
106+
107+
✖ CC201 branch failed: my-changes
108+
The branch should follow Conventional Branch. See https://conventionalbranch.org
109+
Suggest: Use <type>/<description> with an allowed type, or add the branch to allow_branch_names in config
110+
Docs: https://commit-check.com/rules/#cc201
106111
```
107112

108113
Rename it to something structured and it passes:

‎docs/guides/policies.md‎

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,12 @@ ai_attribution = "forbid"
133133
Commits carrying a recognised AI signature now fail:
134134

135135
```text
136-
CC013 ai-attribution check failed ==> Claude Code
137-
AI attribution is forbidden in this project — detected: Claude Code
138-
Suggest: This project does not accept AI attribution in commit messages. Remove the AI trailer lines and re-commit.
139-
Docs: https://commit-check.com/rules/#cc013
136+
✖ Commit rejected by Commit Check · 1 check failed
137+
138+
✖ CC013 ai-attribution failed: Claude Code
139+
AI attribution is forbidden in this project — detected: Claude Code
140+
Suggest: This project does not accept AI attribution in commit messages. Remove the AI trailer lines and re-commit.
141+
Docs: https://commit-check.com/rules/#cc013
140142
```
141143

142144
Recognised signatures are co-author and sign-off lines naming Claude Code,
@@ -255,15 +257,17 @@ A commit that a vendor stamped and nobody disclosed fails the first two, and
255257
the failure carries the disclosure already written:
256258

257259
```text
258-
CC014 ai-disclosure check failed ==> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
259-
AI assistance is not disclosed with Assisted-by or Generated-by — detected: Claude Code
260-
Suggest: Disclose the tool with "Assisted-by: Claude Opus 5"
261-
Docs: https://commit-check.com/rules/#cc014
262-
263-
CC015 ai-co-author check failed ==> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
264-
An AI tool is credited as a co-author: Claude Code
265-
Suggest: Use "Assisted-by: Claude Opus 5" in place of the co-author line
266-
Docs: https://commit-check.com/rules/#cc015
260+
✖ Commit rejected by Commit Check · 2 checks failed
261+
262+
✖ CC014 ai-disclosure failed: Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
263+
AI assistance is not disclosed with Assisted-by or Generated-by — detected: Claude Code
264+
Suggest: Disclose the tool with "Assisted-by: Claude Opus 5"
265+
Docs: https://commit-check.com/rules/#cc014
266+
267+
✖ CC015 ai-co-author failed: Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
268+
An AI tool is credited as a co-author: Claude Code
269+
Suggest: Use "Assisted-by: Claude Opus 5" in place of the co-author line
270+
Docs: https://commit-check.com/rules/#cc015
267271
```
268272

269273
Both carry the same correction in `--format json`: the co-author line rewritten
@@ -306,9 +310,12 @@ ai_disclosure_pattern = '^\S+/\S+$'
306310
```
307311

308312
```text
309-
CC014 ai-disclosure check failed ==> Assisted-by: Claude Code
310-
The Assisted-by value does not match the required pattern: ^\S+/\S+$
311-
Suggest: Write the Assisted-by value so that it matches ^\S+/\S+$ (set by ai_disclosure_pattern in the [commit] config)
313+
✖ Commit rejected by Commit Check · 1 check failed
314+
315+
✖ CC014 ai-disclosure failed: Assisted-by: Claude Code
316+
The Assisted-by value does not match the required pattern: ^\S+/\S+$
317+
Suggest: Write the Assisted-by value so that it matches ^\S+/\S+$ (set by ai_disclosure_pattern in the [commit] config)
318+
Docs: https://commit-check.com/rules/#cc014
312319
```
313320

314321
That failure carries no correction, because the tool should not guess which
@@ -330,11 +337,11 @@ ai_attribution = "disclose"
330337
```
331338

332339
```text
333-
CC014 ai-disclosure check warning ==> 🤖 Generated with [Claude
334-
AI assistance is not disclosed with Assisted-by or Generated-by — detected: Claude Code
335-
Suggest: Disclose the tool with "Assisted-by: Claude Code"
336-
Docs: https://commit-check.com/rules/#cc014
337-
This rule is set to warn in the config; it does not fail the run.
340+
▲ CC014 ai-disclosure warning: 🤖 Generated with [Claude
341+
AI assistance is not disclosed with Assisted-by or Generated-by — detected: Claude Code
342+
Suggest: Disclose the tool with "Assisted-by: Claude Code"
343+
Docs: https://commit-check.com/rules/#cc014
344+
This rule is set to warn in the config; it does not fail the run.
338345
```
339346

340347
The run still passes. The warning still suggests a disclosure that pip and

‎docs/index.md‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ description: Commit policy as code for teams and AI agents. Messages, branches,
3939
</div>
4040
</div>
4141
<!--
42-
A transcript of a real run: commit-check 2.18.0 as a pre-commit
43-
commit-msg hook. The hook also prints an ASCII-art banner between
44-
"exit code: 1" and the CC001 line; it is left out, nothing else is.
42+
A transcript of a real run: commit-check 2.20.4 as a pre-commit
43+
commit-msg hook. Git's own "1 file changed" summary after the last
44+
line is left out, nothing else is.
4545
-->
4646
<figure class="cc-term" aria-label="A commit-msg hook rejects a commit message, suggests the fix, then accepts the corrected message">
4747
<div class="cc-term__bar" aria-hidden="true"><span class="cc-dots"><i></i><i></i><i></i></span><span>~/app · feature/streaming · commit-msg hook</span></div>
@@ -50,14 +50,14 @@ description: Commit policy as code for teams and AI agents. Messages, branches,
5050
<div class="cc-line cc-row" data-on="2500"><span>check commit message</span><span class="cc-leader" aria-hidden="true"></span><span class="cc-t-fail">Failed</span></div>
5151
<div class="cc-line cc-t-dim" data-on="2650">- hook id: check-message</div>
5252
<div class="cc-line cc-t-dim" data-on="2750">- exit code: 1</div>
53-
<div class="cc-line cc-gap" data-on="2900">Commit rejected by Commit-Check.</div>
54-
<div class="cc-line" data-on="3100"><span class="cc-t-fail cc-b">CC001</span> message check failed ==&gt; Fix: add streaming support</div>
55-
<div class="cc-line cc-t-dim" data-on="3250">The commit message should follow Conventional Commits. See https://www.conventionalcommits.org</div>
56-
<div class="cc-line" data-on="3400"><span class="cc-t-blue">Suggest:</span> Use "<span class="cc-t-pass cc-b">fix: add streaming support</span>"</div>
57-
<div class="cc-line cc-t-dim" data-on="3500">Docs: https://commit-check.com/rules/#cc001</div>
53+
<div class="cc-line cc-gap" data-on="2900"><span class="cc-t-fail cc-b">✖ Commit rejected by Commit Check</span><span class="cc-t-dim"> · 1 check failed</span></div>
54+
<div class="cc-line cc-gap" data-on="3100"><span class="cc-t-fail cc-b">✖ CC001</span> message failed: Fix: add streaming support</div>
55+
<div class="cc-line cc-t-dim" data-on="3250"> The commit message should follow Conventional Commits. See https://www.conventionalcommits.org</div>
56+
<div class="cc-line" data-on="3400"> <span class="cc-t-blue">Suggest:</span> Use "<span class="cc-t-pass cc-b">fix: add streaming support</span>"</div>
57+
<div class="cc-line cc-t-dim" data-on="3500"> Docs: https://commit-check.com/rules/#cc001</div>
5858
<div class="cc-line cc-gap" data-on="5200"><span class="cc-sigil">❯ </span><span data-type="5600" data-speed="42">git commit -m "fix: add streaming support"</span><i class="cc-caret" data-from="5200" data-until="7700"></i></div>
5959
<div class="cc-line cc-row" data-on="7700"><span>check commit message</span><span class="cc-leader" aria-hidden="true"></span><span class="cc-t-pass">Passed</span></div>
60-
<div class="cc-line cc-t-dim" data-on="7900">[feature/streaming 77663ff] fix: add streaming support</div>
60+
<div class="cc-line cc-t-dim" data-on="7900">[feature/streaming 276fd07] fix: add streaming support</div>
6161
</div>
6262
</figure>
6363
</div>
@@ -409,10 +409,10 @@ conventional_branch = <span class="cc-t-pass">true</span></div>
409409
<li><span><b>A fix you can paste</b>, whenever the correction is unambiguous.</span></li>
410410
</ol>
411411
</div>
412-
<!-- Real output of commit-check 2.19.2; the ASCII-art banner it prints first is left out. -->
412+
<!-- Real output of commit-check 2.20.4, laid out in numbered rows; the one-line header it prints first is left out. -->
413413
<div class="cc-diag">
414414
<p class="cc-t-dim">$ echo "Fix: add streaming support" | commit-check -m</p>
415-
<p><span class="cc-mark">1</span><span><span class="cc-t-fail cc-b">CC001</span> message check failed ==&gt;</span></p>
415+
<p><span class="cc-mark">1</span><span><span class="cc-t-fail cc-b">✖ CC001</span> message failed:</span></p>
416416
<p><span class="cc-mark">2</span><span class="cc-t-white">Fix: add streaming support</span></p>
417417
<p><span class="cc-mark">3</span><span class="cc-t-dim">The commit message should follow Conventional Commits. See https://www.conventionalcommits.org</span></p>
418418
<p><span class="cc-mark">4</span><span><span class="cc-t-blue">Suggest:</span> Use "<span class="cc-t-pass cc-b">fix: add streaming support</span>"</span></p>

0 commit comments

Comments
 (0)