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
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ 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.24.1 (2026-11-23) { #v2241 }

### Fixed

* CC002 to CC005 skip the `fixup!`, `squash!` and `amend!` subjects `git commit --fixup` and `--squash` write, so a fixup of a subject that fit the limit passes; CC009 still decides whether they are allowed. ([CC004](rules.md#cc004), [#734](https://github.com/commit-check/commit-check/pull/734))

## v2.24.0 (2026-11-22) { #v2240 }

### 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.24.0
rev: v2.24.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 @@ -276,7 +276,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.24.0
rev: v2.24.1
hooks:
- id: check-message
args:
Expand Down Expand Up @@ -403,8 +403,8 @@ These two sit above every section, at the top of the file.
| `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`. |
| `subject_capitalized` | bool | false | Subject must start with a capital letter. |
| `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). |
| `subject_max_length` | int | 80 | Maximum length of the subject line, not counting the ` (#123)` a GitHub squash merge adds. The `Revert "..."` and `Reapply "..."` subjects `git revert` writes are not measured. Commits by `dependabot[bot]` and `renovate[bot]` skip it. `0` turns the check off. |
| `subject_min_length` | int | 5 | Minimum length of the subject line, not counting the ` (#123)` a GitHub squash merge adds. The `Revert "..."` and `Reapply "..."` subjects `git revert` writes are not measured. Commits by `dependabot[bot]` and `renovate[bot]` skip it. `0` turns the check off. |
| `subject_max_length` | int | 80 | Maximum length of the subject line, not counting the ` (#123)` a GitHub squash merge adds. The `Revert "..."` and `Reapply "..."` subjects `git revert` writes, and the `fixup!`, `squash!` and `amend!` ones `git commit --fixup` writes, are not measured. Commits by `dependabot[bot]` and `renovate[bot]` skip it. `0` turns the check off. |
| `subject_min_length` | int | 5 | Minimum length of the subject line, not counting the ` (#123)` a GitHub squash merge adds. The `Revert "..."` and `Reapply "..."` subjects `git revert` writes, and the `fixup!`, `squash!` and `amend!` ones `git commit --fixup` writes, are not measured. Commits by `dependabot[bot]` and `renovate[bot]` skip it. `0` turns the check off. |
| `allow_commit_types` | list[str] | ["feat", "fix", "docs", "style", "refactor", "test", "chore", "perf", "build", "ci", "revert"] | Allowed commit types when conventional_commits is true. |
| `allow_merge_commits` | bool | true | Allow merge commits. |
| `allow_revert_commits` | bool | true | Allow the `Revert "..."` and `Reapply "..."` commits `git revert` writes. |
Expand Down
2 changes: 1 addition & 1 deletion docs/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pushed:
```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/commit-check/commit-check
rev: v2.24.0
rev: v2.24.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.24.0
rev: v2.24.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.24.0
rev: v2.24.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.24.0
rev: v2.24.1
hooks:
- id: check-message
args: [--fix]
Expand Down
14 changes: 13 additions & 1 deletion docs/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ fix: Handle empty input

* `commit.subject_capitalized` — set to `true` to enable this rule.

Merge subjects and the `fixup!`, `squash!` and `amend!` subjects git writes are
not judged: git writes them in lower case, and `--autosquash` would not find a
`Fixup!` commit.

### subject-imperative (CC003) { #cc003 }

**What it does**
Expand Down Expand Up @@ -292,6 +296,9 @@ two apart.

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

Merge subjects and the `fixup!`, `squash!` and `amend!` subjects git writes are
not judged.

### subject-max-length (CC004) { #cc004 }

**What it does**
Expand Down Expand Up @@ -337,6 +344,10 @@ same root cause.
author cannot shorten. Their other checks still run.
* The `Revert "..."` and `Reapply "..."` subjects `git revert` writes, which
add nine characters to a subject that already fit. CC005 skips them too.
* The `fixup!`, `squash!` and `amend!` subjects `git commit --fixup` and
`--squash` write, which add seven or eight characters to a subject that
already fit. CC005 skips them too, and [CC009](#cc009) decides whether they
are allowed.

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

Expand Down Expand Up @@ -367,7 +378,8 @@ 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
The squash-merge ` (#123)`, the two dependency bots and the subjects
`git revert`, `git commit --fixup` and `--squash` write are treated as for
[CC004](#cc004).

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