From 56fc489fb1f0c64c619ca8873e26f511637662a6 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Fri, 7 Aug 2026 09:37:16 +0000 Subject: [PATCH] docs: refresh README sample output to match what commit-check prints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The README's output blocks predate rule IDs, so they showed neither the CCxxx identifiers nor the Docs links that every failure now prints. Same staleness #530 fixed in the demo GIF; the docs site is already current, only the README had been left behind. Measured by running each documented command against this checkout rather than reading the code: Type message check failed ==> ... -> CC001 message check failed ==> ... Type branch check failed ==> ... -> CC201 branch check failed ==> ... plus a trailing `Docs: https://commit-check.com/rules/#ccNNN` line on both, and two commit types the list had never picked up (perf, build). Four more blocks were stale in the same way, so they are refreshed too: - --no-banner carried a line that no longer exists anywhere in the source: "It doesn't match regex: ^(build|chore|ci|...)". grep over *.py finds it only in a test comment. - --compact prints the rule id: [FAIL] CC001 message: ... - Both --format json examples were missing the rule_id and docs_url fields, showed value as "" where it is now populated on pass, and named a subject_imperative check that the default run does not emit — it reports subject_max_length (CC004) and subject_min_length (CC005), and lists passing checks alongside the failing one. - The Python API return-value schema was missing rule_id and docs_url. The API code examples themselves were correct; each was re-run to confirm. Every block was then re-captured and compared byte for byte against the committed text (JSON via json.loads, text with ANSI colours and trailing padding normalised), so these are transcripts, not transcriptions. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn --- README.md | 87 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 68 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index f1ec9590..6e840143 100644 --- a/README.md +++ b/README.md @@ -256,8 +256,33 @@ echo "feat: add streaming support" | commit-check -m --format json { "status": "pass", "checks": [ - { "check": "message", "status": "pass", "value": "", "error": "", "suggest": "" }, - { "check": "subject_imperative", "status": "pass", "value": "", "error": "", "suggest": "" } + { + "rule_id": "CC001", + "check": "message", + "status": "pass", + "value": "feat: add streaming support", + "error": "", + "suggest": "", + "docs_url": "https://commit-check.com/rules/#cc001" + }, + { + "rule_id": "CC004", + "check": "subject_max_length", + "status": "pass", + "value": "feat: add streaming support", + "error": "", + "suggest": "", + "docs_url": "https://commit-check.com/rules/#cc004" + }, + { + "rule_id": "CC005", + "check": "subject_min_length", + "status": "pass", + "value": "feat: add streaming support", + "error": "", + "suggest": "", + "docs_url": "https://commit-check.com/rules/#cc005" + } ] } ``` @@ -274,11 +299,31 @@ echo "wip bad commit" | commit-check -m --format json "status": "fail", "checks": [ { - "check": "message", - "status": "fail", - "value": "wip bad commit", - "error": "The commit message should follow Conventional Commits. See https://www.conventionalcommits.org", - "suggest": "Use (): , where is one of: feat, fix, docs, ..." + "rule_id": "CC001", + "check": "message", + "status": "fail", + "value": "wip bad commit", + "error": "The commit message should follow Conventional Commits. See https://www.conventionalcommits.org", + "suggest": "Use (): , where is one of: feat, fix, docs, style, refactor, test, chore, perf, build, ci", + "docs_url": "https://commit-check.com/rules/#cc001" + }, + { + "rule_id": "CC004", + "check": "subject_max_length", + "status": "pass", + "value": "wip bad commit", + "error": "", + "suggest": "", + "docs_url": "https://commit-check.com/rules/#cc004" + }, + { + "rule_id": "CC005", + "check": "subject_min_length", + "status": "pass", + "value": "wip bad commit", + "error": "", + "suggest": "", + "docs_url": "https://commit-check.com/rules/#cc005" } ] } @@ -299,10 +344,10 @@ echo "wip bad commit" | commit-check -m --no-banner ``` ```text -Type message check failed ==> wip bad commit -It doesn't match regex: ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)|(Merge).*|(fixup!.*) +CC001 message check failed ==> wip bad commit The commit message should follow Conventional Commits. See https://www.conventionalcommits.org -Suggest: Use (): , where is one of: feat, fix, docs, ... +Suggest: Use (): , where is one of: feat, fix, docs, style, refactor, test, chore, perf, build, ci +Docs: https://commit-check.com/rules/#cc001 ``` ```bash @@ -310,7 +355,7 @@ echo "wip bad commit" | commit-check -m --compact ``` ```text -[FAIL] message: wip bad commit +[FAIL] CC001 message: wip bad commit ``` ### Python API (no subprocess required) @@ -359,11 +404,13 @@ print(result["status"]) # "fail" — 'docs' not in allowed types "status": "pass" | "fail", "checks": [ { - "check": "", - "status": "pass" | "fail", - "value": "", - "error": "", - "suggest": "", + "rule_id": "", + "check": "", + "status": "pass" | "fail", + "value": "", + "error": "", + "suggest": "", + "docs_url": "", }, # ... one entry per active rule ] @@ -397,9 +444,10 @@ Commit rejected by Commit-Check. Commit rejected. -Type message check failed ==> test commit message check +CC001 message check failed ==> test commit message check The commit message should follow Conventional Commits. See https://www.conventionalcommits.org -Suggest: Use (): , where is one of: feat, fix, docs, style, refactor, test, chore, ci +Suggest: Use (): , where is one of: feat, fix, docs, style, refactor, test, chore, perf, build, ci +Docs: https://commit-check.com/rules/#cc001 ``` ### Check Branch Naming Failed @@ -418,9 +466,10 @@ Commit rejected by Commit-Check. Commit rejected. -Type branch check failed ==> test-branch +CC201 branch check failed ==> test-branch The branch should follow Conventional Branch. See https://conventionalbranch.org Suggest: Use / with allowed types or add branch name to allow_branch_names in config, or use ignore_authors in config branch section to bypass +Docs: https://commit-check.com/rules/#cc201 ``` For more examples, see the [example documentation](https://commit-check.com/example/).