Skip to content

Commit 9c806a2

Browse files
authored
docs: pin v2.21.1 and document the CC004 squash suffix and bot skip (#87)
1 parent 1ed5f94 commit 9c806a2

6 files changed

Lines changed: 30 additions & 8 deletions

File tree

‎docs/changelog.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ page that documents it.
1111

1212
| Version | What changed | Documented in |
1313
|---|---|---|
14+
| [2.21.1](#v2211) | Subject length rules leave out a squash merge's ` (#123)` and skip Dependabot and Renovate commits | [CC004](rules.md#cc004) · [CC005](rules.md#cc005) |
1415
| [2.21.0](#v2210) | A pull request description must tick one of its template's AI declaration checkboxes (opt-in) | [CC501](rules.md#cc501) · [Requiring the template's AI declaration](guides/policies.md#requiring-the-templates-ai-declaration) |
1516
| [2.20.5](#v2205) | The author checks cover a repository's first commit; a run takes about half the time to start; releases on PyPI carry provenance | [Checking the committer](example.md#checking-the-committer) · [CC017](rules.md#cc017) |
1617
| [2.20.3](#v2203) | Failures print a one-line header and an indented block per check, in place of the ASCII banner; an agent skill for coding agents | [Getting started](getting-started.md#2-watch-it-reject-something) · [With AI coding agents](guides/ai-agents.md#tell-the-agent) |
@@ -41,6 +42,14 @@ page that documents it.
4142
| [2.5.0](#v250) | Organization-wide config with `inherit_from` | [Across an organization](guides/organization.md) |
4243
| [2.0.0](#v200) | Configuration moved from YAML to TOML — breaking | [Migrating from v1](migration.md) |
4344

45+
## v2.21.1 (2026-11-18) { #v2211 }
46+
47+
### Fixed
48+
49+
* CC004 and CC005 do not count the ` (#123)` a GitHub squash merge adds to the subject, so a pull request that passed no longer fails on the push that lands it. ([CC004](rules.md#cc004), [#704](https://github.com/commit-check/commit-check/pull/704))
50+
* CC004 and CC005 skip commits by `dependabot[bot]` and `renovate[bot]`, whose subjects are built from package names and versions. ([CC004](rules.md#cc004), [#705](https://github.com/commit-check/commit-check/pull/705))
51+
* A forced push over commits the clone never fetched has every pushed commit checked by the push and file rules, not only its tip. ([Push and file rules](rules.md#push-rules), [#703](https://github.com/commit-check/commit-check/pull/703))
52+
4453
## v2.21.0 (2026-11-16) { #v2210 }
4554

4655
### Added

‎docs/compare/tools.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Replace the hook:
6565
```yaml title=".pre-commit-config.yaml"
6666
repos:
6767
- repo: https://github.com/commit-check/commit-check
68-
rev: v2.21.0
68+
rev: v2.21.1
6969
hooks:
7070
- id: check-message
7171
```

‎docs/configuration.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ Used from a hook definition, with no config file anywhere in the repository:
274274
```yaml title=".pre-commit-config.yaml"
275275
repos:
276276
- repo: https://github.com/commit-check/commit-check
277-
rev: v2.21.0
277+
rev: v2.21.1
278278
hooks:
279279
- id: check-message
280280
args:
@@ -387,8 +387,8 @@ the same thing twice, so read the description rather than the cell:
387387
| 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`. |
388388
| commit | subject_capitalized | bool | false | Subject must start with a capital letter. |
389389
| 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). |
390-
| commit | subject_max_length | int | 80 | Maximum length of the subject line. `0` turns the check off. |
391-
| commit | subject_min_length | int | 5 | Minimum length of the subject line. `0` turns the check off. |
390+
| commit | subject_max_length | int | 80 | Maximum length of the subject line, not counting the ` (#123)` a GitHub squash merge adds. Commits by `dependabot[bot]` and `renovate[bot]` skip it. `0` turns the check off. |
391+
| commit | subject_min_length | int | 5 | Minimum length of the subject line, not counting the ` (#123)` a GitHub squash merge adds. Commits by `dependabot[bot]` and `renovate[bot]` skip it. `0` turns the check off. |
392392
| commit | allow_commit_types | list[str] | ["feat", "fix", "docs", "style", "refactor", "test", "chore", "perf", "build", "ci"] | Allowed commit types when conventional_commits is true. |
393393
| commit | allow_merge_commits | bool | true | Allow merge commits. |
394394
| commit | allow_revert_commits | bool | true | Allow revert commits. |

‎docs/example.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pushed:
169169
```yaml title=".pre-commit-config.yaml"
170170
repos:
171171
- repo: https://github.com/commit-check/commit-check
172-
rev: v2.21.0
172+
rev: v2.21.1
173173
hooks:
174174
- id: check-no-force-push
175175
stages: [pre-push]

‎docs/guides/pre-commit.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Add Commit Check to `.pre-commit-config.yaml`:
88
```yaml title=".pre-commit-config.yaml"
99
repos:
1010
- repo: https://github.com/commit-check/commit-check
11-
rev: v2.21.0
11+
rev: v2.21.1
1212
hooks:
1313
- id: check-message
1414
- id: check-branch
@@ -68,7 +68,7 @@ Options can be passed as hook arguments, which keeps everything in one file:
6868
```yaml title=".pre-commit-config.yaml"
6969
repos:
7070
- repo: https://github.com/commit-check/commit-check
71-
rev: v2.21.0
71+
rev: v2.21.1
7272
hooks:
7373
- id: check-message
7474
args:
@@ -90,7 +90,7 @@ colon, and lets the commit through:
9090
```yaml title=".pre-commit-config.yaml"
9191
repos:
9292
- repo: https://github.com/commit-check/commit-check
93-
rev: v2.21.0
93+
rev: v2.21.1
9494
hooks:
9595
- id: check-message
9696
args: [--fix]

‎docs/rules.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,16 @@ same root cause.
318318
* `commit.subject_max_length` — the limit, in characters. Defaults to `80`.
319319
`50` and `72` are the other conventional choices. `0` turns the rule off.
320320

321+
**Not counted**
322+
323+
* The ` (#123)` GitHub adds to the end of a squash-merged subject. Those
324+
characters are GitHub's, not the author's, so a pull request title that
325+
fits still fits after the merge. A failure says what was left out:
326+
`Subject is 86 characters, not counting "(#1698)"; it must be at most 80 characters`.
327+
* Commits by `dependabot[bot]` and `renovate[bot]` skip this rule and CC005.
328+
Those bots build the subject from the package name and versions, which the
329+
author cannot shorten. Their other checks still run.
330+
321331
### subject-min-length (CC005) { #cc005 }
322332

323333
**What it does**
@@ -347,6 +357,9 @@ fix: reject config files with a null inherit_from
347357
* `commit.subject_min_length` — the minimum, in characters. Defaults to `5`.
348358
`0` turns the rule off.
349359

360+
The squash-merge ` (#123)` and the two dependency bots are treated as for
361+
[CC004](#cc004).
362+
350363
### allow-merge-commits (CC006) { #cc006 }
351364

352365
**What it does**

0 commit comments

Comments
 (0)