feat: co-author ignore, org-level config inheritance, git-config author validation, test mock fix#387
Conversation
✅ Deploy Preview for commit-check ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…, fix test mocks Agent-Logs-Url: https://github.com/commit-check/commit-check/sessions/df24f9f7-eeb8-484b-8834-3df9562cd04c Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
Agent-Logs-Url: https://github.com/commit-check/commit-check/sessions/df24f9f7-eeb8-484b-8834-3df9562cd04c Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
Merging this PR will degrade performance by 37.34%
|
Agent-Logs-Url: https://github.com/commit-check/commit-check/sessions/f03720f4-ae2f-43e3-885c-789810b5f0b4 Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
…' into copilot/make-commit-check-famous # Conflicts: # tests/config_test.py Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #387 +/- ##
==========================================
+ Coverage 95.04% 95.17% +0.13%
==========================================
Files 9 9
Lines 807 892 +85
==========================================
+ Hits 767 849 +82
- Misses 40 43 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|

Makes commit-check the most comprehensive Git commit/branch enforcement tool by fixing three open issues and adding a high-value organizational feature.
Bug fixes
#test):test_main_with_message_empty_string_no_stdin_with_gitwas patchingcommit_check.util.get_commit_info— ineffective sinceengine.pyimports the function directly. Fixed to patchcommit_check.engine.get_commit_info. Also changed the test message to use an imperative verb to work withsubject_imperative = true.New features
Co-author bypass in
ignore_authors(Issue #290)_should_skip_commit_validation()now parsesCo-authored-by:trailers. If any co-author name matchesignore_authors, all commit checks are skipped. Fixes the common pattern where AI bots (e.g., coderabbitai) co-author commits with non-conventional messages.Organization-level config inheritance via
inherit_from(Issue #384)New top-level
inherit_fromkey in TOML config. Supports agithub:shorthand (modelled after Release Drafter), local file paths, and HTTPS URLs. HTTP (non-TLS) is rejected to prevent MITM attacks. Parent config is loaded first; local keys override.Supported formats:
github:owner/repo:path/to/cchk.toml— fetches fromraw.githubusercontent.comatHEADgithub:owner/repo@ref:path/to/cchk.toml— pins to a specific branch/tag/SHAGit config author validation (Issue #298)
Added
get_git_config_value(key)utility.AuthorValidatornow checksgit config user.name/user.emailfirst (the identity that will be used for the next commit), falling back togit logif unset. Previously, a misconfigureduser.name(e.g., starting with a digit) would pass if the last commit had a valid author.Other
cchk.toml: addedcoderabbitai[bot]toignore_authorsinherit_fromdocs, additional badgesdocs/configuration.rst:inherit_fromsection withgithub:shorthand examples, updatedignore_authorsdescriptiongithub:shorthand)Original prompt