← 输入框|github.com|刷新
Skip to content

feat: replace the ASCII banner with a one-line failure header - #682

Merged
shenxianpeng merged 4 commits into
mainfrom
feature/polished-failure-output
Nov 9, 2026
Merged

shenxianpeng merged 4 commits into
mainfrom
feature/polished-failure-output

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

What

The failure report in text mode gets a cleaner layout, and the README demo GIF is re-recorded with it (#683 was merged into this branch).

  • The 10-line ASCII-art banner becomes one header line: ✖ Commit rejected by Commit Check · 3 checks failed (names Branch / Tag / Push like before, with a count).
  • Each failure starts with a ✖ marker (▲ for a warn rule): ✖ CC001 message failed: <value>, in place of CC001 message check failed ==> <value>.
  • Explanation, Suggest: and Docs: are indented under it; Suggest: is bold green, Docs: is dimmed.
  • A whole commit message used as the value shows only its subject, plus (+N more line), so trailers no longer appear in red between the value and the explanation.
  • Falls back to plain x / ! when stdout cannot encode the symbols (legacy Windows code pages).
  • assets/demo.gif + assets/demo.tape: cchk.toml, one commit rejected for message (CC001), AI co-author (CC013) and branch (CC201), then --fix correcting Feat add login page and the commit passing.

Unchanged: --format json, --compact, exit codes, --no-banner (now hides the header line), NO_COLOR / FORCE_COLOR, hyperlink handling. The Action and the App read JSON, so their output is not affected.

Before / after

Output, commit-check -m msg -b --ai-attribution forbid with a message Add login page + a Co-authored-by: Claude trailer, on branch user-login:

before and after

Demo GIF, first frame:

gif before and after

Follow-up

The text samples on commit-check.com (getting-started, troubleshoot, landing terminal) show the old format; they need a small update once this ships in a release.

@shenxianpeng
shenxianpeng requested a review from a team as a code owner November 9, 2026 20:22
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1ae45048-778d-4292-bc48-85a890ae7679
Commits

Reviewing files that changed from the base of the PR and between fce484f and a096379.

Files ignored due to path filters: 1

  • assets/demo.gif is excluded by !**/*.gif
Files selected for processing: 9

  • assets/demo.tape
  • commit_check/__init__.py
  • commit_check/engine.py
  • commit_check/main.py
  • commit_check/util.py
  • tests/engine_fixes_test.py
  • tests/engine_test.py
  • tests/main_test.py
  • tests/util_test.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the enhancement New feature or request label Nov 9, 2026
@shenxianpeng shenxianpeng self-assigned this Nov 9, 2026
@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (fce484f) to head (a096379).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #682   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines         2519      2529   +10     
  Branches       488       491    +3     
=========================================
+ Hits          2519      2529   +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

A failure now opens with one line naming what was rejected and how many
checks failed, then lists each failure under a marker, with its
explanation, suggestion and docs link indented beneath it. A commit
message shown as the failing value is cut to its subject, with a count
of the lines left out. JSON and --compact output are unchanged.
@shenxianpeng
shenxianpeng force-pushed the feature/polished-failure-output branch from cbe1be9 to e17aae5 Compare November 9, 2026 20:27
* docs: re-record the demo GIF to show the key checks

The demo now opens on a project's cchk.toml and one commit that breaks
it three ways: a non-conventional message, an AI co-author trailer and
a non-conventional branch name. It then shows the commit-msg hook
fixing a mechanical slip on its own and the commit going through.

* docs: add before/after screenshot for review

* docs: drop the review screenshot

---------

Co-authored-by: Xianpeng Shen <3353385+shenxianpeng@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

@shenxianpeng
shenxianpeng merged commit c58b1ea into main Nov 9, 2026
32 of 34 checks passed
@shenxianpeng
shenxianpeng deleted the feature/polished-failure-output branch November 9, 2026 20:37
@codspeed

codspeed Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 28.59%

1 warning

⚠️ 135 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚡ 2 improved benchmarks
✅ 682 untouched benchmarks
⏩ 131 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ test_print_error_header 487.5 µs 373.8 µs +30.42%
⚡ test_print_error_header_takes_the_headline 467.4 µs 368.7 µs +26.79%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing feature/polished-failure-output (a096379) with main (3cf6a1e)2

Open in CodSpeed

Footnotes

  1. 131 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (fce484f) during the generation of this report, so 3cf6a1e was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant