Skip to content

Commit 9a3f758

Browse files
authored
docs: record the CC003 morphology change, and correct what CC003 claims (#13)
1 parent baf97ab commit 9a3f758

3 files changed

Lines changed: 46 additions & 4 deletions

File tree

‎docs/changelog.md‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ below and to the page that documents the feature properly.
1111

1212
| Version | What changed | Documented in |
1313
|---|---|---|
14+
| [2.14.0](#v2140) | CC003 judges imperative mood by a word's form, not by a list of verbs | [CC003](rules.md#cc003) |
1415
| [2.13.1](#v2131) | JSON output reports the checked value for passing checks | [Output for scripts and CI](example.md#output-for-scripts-and-ci) |
1516
| [2.13.0](#v2130) | Stable rule IDs in terminal output and JSON | [Rules reference](rules.md) |
1617
| [2.12.0](#v2120) | Author name and email patterns became configurable | [CC101](rules.md#cc101) · [CC102](rules.md#cc102) |
@@ -23,6 +24,37 @@ below and to the page that documents the feature properly.
2324
| [2.5.0](#v250) | Organization-wide config with `inherit_from` | [Integrations](guides/integrations.md#across-an-organization) |
2425
| [2.0.0](#v200) | Configuration moved from YAML to TOML — breaking | [Migrating from v1](migration.md) |
2526

27+
## v2.14.0 (unreleased) { #v2140 }
28+
29+
### Changed
30+
31+
* **CC003 judges the word's form, not its membership in a list** — the rule
32+
used to accept a subject only when its first word appeared in a list of
33+
known imperative verbs, so any verb the list had not heard of was reported
34+
as a mood error. Growing the list never fixed that; each release recognised
35+
a few more verbs and the next contributor found the next gap.
36+
37+
It now works the other way round. A first word is rejected only when it
38+
carries non-imperative morphology — a past tense (`fixed`), a gerund
39+
(`adding`) or a third person singular (`fixes`) — and accepted otherwise.
40+
Measured across 59,140 subjects from `git.git`, a project that writes
41+
strictly imperative subjects, the old list rejected 45.5% of them; the new
42+
rule rejects 0.97%.
43+
44+
Nothing that passed before fails now. Two things that used to fail now pass:
45+
46+
* Subjects led by a correct verb no list contained — `reword the report
47+
format`, `dedupe the helper`, `backfill an absent value`.
48+
* Subjects led by a noun — `parser improvements`. CC003 checks mood, and a
49+
noun phrase has none to get wrong.
50+
51+
The practical consequence is that **`IMPERATIVES` no longer needs additions**.
52+
A verb missing from it can no longer cause a failure, so there is no reason
53+
to send a patch adding the verb you just used.
54+
55+
See PR [#540](https://github.com/commit-check/commit-check/pull/540), which
56+
closes issue [#526](https://github.com/commit-check/commit-check/issues/526).
57+
2658
## v2.13.1 (2026-08-05) { #v2131 }
2759

2860
### New Features

‎docs/configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ the same thing twice, so read the description rather than the cell:
253253
| commit | conventional_commits | bool | true | Enforce Conventional Commits specification. |
254254
| commit | message_pattern | str | "" (no custom pattern) | Custom regex pattern for commit message validation. When set, this pattern replaces the auto-generated Conventional Commits regex entirely, making it possible to enforce custom formats such as JIRA smart commits (e.g., `"^PROJ-\\d+: .+"`). When `message_pattern` is set (non-empty) it takes precedence over `conventional_commits`. |
255255
| commit | subject_capitalized | bool | false | Subject must start with a capital letter. |
256-
| commit | subject_imperative | bool | false | Subject must be in imperative mood. Forms of verbs can be found at [imperatives.py](https://github.com/commit-check/commit-check/blob/main/commit_check/imperatives.py) |
256+
| commit | subject_imperative | bool | false | Subject must be in imperative mood. Judged on the first word's form, so a verb no list contains is still accepted — see [CC003](rules.md#cc003). |
257257
| commit | subject_max_length | int | 80 | Maximum length of the subject line. |
258258
| commit | subject_min_length | int | 5 | Minimum length of the subject line. |
259259
| commit | allow_commit_types | list[str] | ["feat", "fix", "docs", "style", "refactor", "test", "chore", "perf", "build", "ci"] | Allowed commit types when conventional_commits is true. |

‎docs/rules.md‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,23 @@ Use instead:
213213
fix: handle an empty config file
214214
```
215215

216+
**What it does not do**
217+
218+
The rule reads the *form* of the first word, not a vocabulary, so it does not
219+
need to recognise your verb. Anything that is not a past tense, a gerund or a
220+
third-person singular is accepted — including verbs no word list contains, and
221+
subjects that lead with a noun (`fix: parser improvements`), which have no mood
222+
to get wrong.
223+
224+
The trade is that a word's form does not always tell you how it is being used.
225+
`fix: spelling in the docs` is reported: `spelling` is a noun there, but it
226+
wears the `-ing` of a gerund, and a rule that reads the ending cannot tell the
227+
two apart.
228+
216229
**Options**
217230

218231
* `commit.subject_imperative` — set to `true` to enable this rule.
219232

220-
The list of recognised non-imperative verb forms lives in
221-
[imperatives.py](https://github.com/commit-check/commit-check/blob/main/commit_check/imperatives.py).
222-
223233
### subject-max-length (CC004) { #cc004 }
224234

225235
**What it does**

0 commit comments

Comments
 (0)