Repository navigation
fix: skip the subject length rules for Dependabot and Renovate commits - #705
Conversation
Both bots write the subject from the package path and versions, so a long one is not a person's to shorten, and a repository had to ignore the bots altogether or raise the limit for everyone. CC004 and CC005 now skip a commit whose author is dependabot[bot] or renovate[bot]; every other rule still judges it. The author is looked up only once a subject is out of bounds.
|
Warning Review limit reachedYou'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 51 minutes. View limit details
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #705 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 2710 2727 +17
Branches 537 541 +4
=========================================
+ Hits 2710 2727 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ot-commits # Conflicts: # README.md # commit_check/engine.py # tests/engine_test.py
A title that already ends in a number, such as a backport's " (#12)", gets a second one from the squash merge, and only the last was left out, so a title that passed on the pull request could fail once merged.
|
Merging this PR will not alter performance1 warning
Comparing Footnotes
|



Before: Dependabot and Renovate write the subject from the package path and versions. With the default 80-character limit, an update to a package with a long name fails CC004 on the bot's own pull request, and nobody can shorten it:
The ways around it were to put the bot in
ignore_authors, which turns off every commit rule for it, or to raise the limit for everyone.After: The two length rules skip that commit and say why; every other rule still judges it:
The same subject from anyone else fails CC004 as before.
How:
SubjectLengthValidatorasks for the author only once a subject is out of bounds, so a passing subject costs no lookup. The author comes from the commit for--revand for HEAD, and fromGIT_AUTHOR_NAMEfor a piped message or message file, which is how the Action passes each pull request commit's author. A piped message does not fall back to the local git config: a local hook's author is a person, and the benchmarked failure tests start no git process. The names match exactly:dependabot[bot]andrenovate[bot](new tupleDEPENDENCY_UPDATE_BOTS).Only the length rules are skipped, not every rule, so a commit that names itself
dependabot[bot]still gets the format, AI and sign-off rules; spoofing the name buys nothing beyond the length.No new option, check or rule ID. README: the CC004 row says the bots skip both length rules.
ignore_authorskeeps its default[].Tests: both bots skipped via
GIT_AUTHOR_NAME,--revand HEAD; a person with the same subject fails; near-miss names (dependabot,Dependabot[bot]) fail; a passing subject looks up no author; a piped message does not read git config; through the engine, CC004 skips while CC001 still fails a bot's non-conventional subject.Merged main after #704. One more commit on top, 8b9f9cf, finishes #704: a title that already ends in a number, such as a backport's
(#12), gets a second(#34)from the squash merge, and only the last one was left out. The whole trailing run is now left out, so the title measures the same before and after the merge (test added). 1702 tests pass, coverage 100%.