Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ page that documents it.

| Version | What changed | Documented in |
|---|---|---|
| [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) |
| [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) |
| [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) |
| [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) |
Expand Down Expand Up @@ -41,6 +42,14 @@ page that documents it.
| [2.5.0](#v250) | Organization-wide config with `inherit_from` | [Across an organization](guides/organization.md) |
| [2.0.0](#v200) | Configuration moved from YAML to TOML — breaking | [Migrating from v1](migration.md) |

## v2.21.1 (2026-11-18) { #v2211 }

### Fixed

* 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))
* 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))
* 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))

## v2.21.0 (2026-11-16) { #v2210 }

### Added
Expand Down
2 changes: 1 addition & 1 deletion docs/compare/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Replace the hook:
```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/commit-check/commit-check
rev: v2.21.0
rev: v2.21.1
hooks:
- id: check-message
```
Expand Down
6 changes: 3 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ Used from a hook definition, with no config file anywhere in the repository:
```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/commit-check/commit-check
rev: v2.21.0
rev: v2.21.1
hooks:
- id: check-message
args:
Expand Down Expand Up @@ -387,8 +387,8 @@ the same thing twice, so read the description rather than the cell:
| 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`. |
| commit | subject_capitalized | bool | false | Subject must start with a capital letter. |
| 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). |
| commit | subject_max_length | int | 80 | Maximum length of the subject line. `0` turns the check off. |
| commit | subject_min_length | int | 5 | Minimum length of the subject line. `0` turns the check off. |
| 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. |
| 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. |
| commit | allow_commit_types | list[str] | ["feat", "fix", "docs", "style", "refactor", "test", "chore", "perf", "build", "ci"] | Allowed commit types when conventional_commits is true. |
| commit | allow_merge_commits | bool | true | Allow merge commits. |
| commit | allow_revert_commits | bool | true | Allow revert commits. |
Expand Down
2 changes: 1 addition & 1 deletion docs/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ pushed:
```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/commit-check/commit-check
rev: v2.21.0
rev: v2.21.1
hooks:
- id: check-no-force-push
stages: [pre-push]
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/pre-commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Add Commit Check to `.pre-commit-config.yaml`:
```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/commit-check/commit-check
rev: v2.21.0
rev: v2.21.1
hooks:
- id: check-message
- id: check-branch
Expand Down Expand Up @@ -68,7 +68,7 @@ Options can be passed as hook arguments, which keeps everything in one file:
```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/commit-check/commit-check
rev: v2.21.0
rev: v2.21.1
hooks:
- id: check-message
args:
Expand All @@ -90,7 +90,7 @@ colon, and lets the commit through:
```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/commit-check/commit-check
rev: v2.21.0
rev: v2.21.1
hooks:
- id: check-message
args: [--fix]
Expand Down
13 changes: 13 additions & 0 deletions docs/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,16 @@ same root cause.
* `commit.subject_max_length` — the limit, in characters. Defaults to `80`.
`50` and `72` are the other conventional choices. `0` turns the rule off.

**Not counted**

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

### subject-min-length (CC005) { #cc005 }

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

The squash-merge ` (#123)` and the two dependency bots are treated as for
[CC004](#cc004).

### allow-merge-commits (CC006) { #cc006 }

**What it does**
Expand Down