Repository navigation
fix(rules): report the case that matched in case rule failure messages - #4962
Merged
escapedcat merged 2 commits intoAug 22, 2026
Conversation
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code defect identified. The five rules preserve their existing pass/fail calculation while retaining all matching checks solely to improve failure-message precision, and the added tests cover single matches, multiple matches, no matches, and conventional-config integration.
|
| Filename | Overview |
|---|---|
| @commitlint/rules/src/body-case.ts | Collects matching body-case checks and uses them to produce more precise never failure messages. |
| @commitlint/rules/src/header-case.ts | Applies the same matched-case diagnostic behavior to headers while preserving validation results. |
| @commitlint/rules/src/scope-case.ts | Reports matching scope cases while retaining existing segmented-scope and delimiter handling. |
| @commitlint/rules/src/subject-case.ts | Reports matching subject cases without altering the existing Unicode-aware subject eligibility logic. |
| @commitlint/rules/src/type-case.ts | Reports only matching type cases for failed never rules while preserving existing verdict semantics. |
| @commitlint/config-conventional/src/index.test.ts | Updates integration expectations to verify input-specific subject-case diagnostics. |
Reviews (1): Last reviewed commit: "fix(rules): report the case that matched..." | Re-trigger Greptile
Merged
via the queue into
conventional-changelog:master
with commit Aug 22, 2026
9f5f7bc
12 checks passed
This was referenced Sep 19, 2026
sys-support
pushed a commit
to 3caravelle/renovate
that referenced
this pull request
Sep 21, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@commitlint/cli](https://commitlint.js.org/) ([source](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli)) | [`21.2.2` → `21.2.3`](https://renovatebot.com/diffs/npm/@commitlint%2fcli/21.2.2/21.2.3) |  |  | | [@commitlint/config-conventional](https://commitlint.js.org/) ([source](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-conventional)) | [`21.2.2` → `21.2.3`](https://renovatebot.com/diffs/npm/@commitlint%2fconfig-conventional/21.2.2/21.2.3) |  |  | --- ### Release Notes <details> <summary>conventional-changelog/commitlint (@​commitlint/cli)</summary> ### [`v21.2.3`](https://github.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cli/CHANGELOG.md#2123-2026-09-19) [Compare Source](conventional-changelog/commitlint@v21.2.2...v21.2.3) ##### Bug Fixes - **lint:** trim trailing whitespace off the message handed to ignore matchers ([#​4960](conventional-changelog/commitlint#4960)) ([a6f279b](conventional-changelog/commitlint@a6f279b)) </details> <details> <summary>conventional-changelog/commitlint (@​commitlint/config-conventional)</summary> ### [`v21.2.3`](https://github.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/config-conventional/CHANGELOG.md#2123-2026-09-19) [Compare Source](conventional-changelog/commitlint@v21.2.2...v21.2.3) ##### Bug Fixes - **rules:** report the case that matched in case rule failure messages ([#​4962](conventional-changelog/commitlint#4962)) ([9f5f7bc](conventional-changelog/commitlint@9f5f7bc)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi44MS4zIiwidXBkYXRlZEluVmVyIjoiNDIuODEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://git.3caravelle.net/3Caravelle/renovate/pulls/59 Co-authored-by: Renovate Bot <renovate-bot@3caravelle.com>
1 task
4 of 5 tasks
Vivswan
added a commit
to Vivswan/repo-platform
that referenced
this pull request
Nov 20, 2026
…21.2.3 names in a subject-case failure commitlint 21.2.3 reports the case a subject matched instead of the four the rule refuses (conventional-changelog/commitlint#4962). The verdict is the same; only the line a committer reads is shorter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
All five case rules listed every configured case in the failure message, matched or not. Under
neverthey now name only the case(s) the input matched.For the
scope-case: [2, "never", ["sentence-case", "start-case"]]example in #3501:start-casenever matchedClearlyDefined, becausestartCase()returnsClearly Defined. It appeared in the message only because it was configured.Under
alwaysa failure means nothing matched, so those messages keep listing every configured case.Motivation and Context
#3501 reads as if
start-casefired on a camel-cased scope. #3312 has the same shape:JTD types -> JSON schema typesis reported asupper-casewhen onlysentence-casematches. Case semantics are untouched, per the conclusion in #3501.Usage examples
Under
config-conventional, each rejected subject now names its own reason:How Has This Been Tested?
pnpm buildandpnpm testpass. 20 new unit tests, four per rule:nevermatching one case,nevermatching a subset,alwaysmatching none,nevermatching none. Reverting the source change fails 10 of them plus theconfig-conventionalmessage test.Verdict neutrality was measured. 56,909 unique conventional commit messages from 16 public repos went through the five rules under 14 configs spanning
always,never, and per-checkwhenobjects. Of 796,726 pass/fail verdicts, 0 changed.Types of changes
Checklist: