Repository navigation
feat: show a one-screen intro when commit-check runs without a check - #718
Conversation
A bare commit-check printed all 152 lines of the argparse help. It now prints the version, three common commands, the config the run would read and the docs link. --help opens with a one-line usage instead of a 20-line list of every flag.
Walkthrough
Merge Risk:
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #718 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 16 16
Lines 2980 2995 +15
Branches 583 584 +1
=========================================
+ Hits 2980 2995 +15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will improve performance by ×3.41 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
Docs for CLI v2.23.1, which ships commit-check/commit-check#724. - **Pins:** every pre-commit `rev:` moves from `v2.23.0` to `v2.23.1` (Configuration, Example, Compare, pre-commit guide). docs-sync checks these against PyPI. - **Changelog:** a v2.23.1 entry and a Highlights row: the message quoted once over several failures (commit-check/commit-check#719), the intro on a bare `commit-check` (commit-check/commit-check#718), and git's revert subjects plus the `revert` type (commit-check/commit-check#724). - **Configuration:** `revert` is added to the `allow_commit_types` default. The length rows say `Revert "..."` and `Reapply "..."` subjects are not measured, and `allow_revert_commits` now names both subjects. - **Rules:** CC001 accepts git's revert subjects and points hand-written reverts to the `revert` type. CC004 lists them under "Not counted". CC007 covers `Reapply "..."` too. - **Migration:** the warning no longer tells v1 users to add `revert` back. It keeps the `task` branch type. - **Examples:** the sample CC001 output in Getting started, Example and Other CI lists `revert`. The two-failure sample in the policy guide was rerun on 2.23.1 and is unchanged. `pytest tests/` (docs-sync, against commit-check 2.23.1 from PyPI) and `nox -s docs` (`mkdocs build --strict`) pass locally. --------- Co-authored-by: Xianpeng Shen <3353385+shenxianpeng@users.noreply.github.com>



What
Running
commit-checkwith no check flag printed all 152 lines of the argparse help. Someone typing the name to see what it is got a wall of[--flag VALUE]brackets first.Now a bare run prints one screen: version, three common commands, which config the run would read (or that the defaults apply), and the docs link. Exit code is still 0.
--helpopens with a one-line usage (usage: commit-check [options] [commit_msg_file]) instead of 20 lines of every flag. The option list under it is unchanged.Before / after
Wording to review
New user-facing text, please check before merge:
Commit Check 2.23.0 · commit policy as codecheck the last commit message and the branch/check a message before you commit it/list every optionConfig none found, using the defaults: Conventional Commits, Conventional Branch, subjects up to 80 charactersConfig cchk.toml(path relative to where you run it)Tests
test_no_args_shows_helpnow checks the intro and that it fits in 12 lines--helpusage is one linetest_load_config_file_permission_error) also fails on main when run as rootSummary by CodeRabbit