diff --git a/docs/changelog.md b/docs/changelog.md index f271cf8..18d5491 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -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) | @@ -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 diff --git a/docs/compare/tools.md b/docs/compare/tools.md index 1bc6b10..4466b0f 100644 --- a/docs/compare/tools.md +++ b/docs/compare/tools.md @@ -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 ``` diff --git a/docs/configuration.md b/docs/configuration.md index c1781d7..7a154f7 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -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: @@ -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. | diff --git a/docs/example.md b/docs/example.md index e55c8bc..5bb067b 100644 --- a/docs/example.md +++ b/docs/example.md @@ -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] diff --git a/docs/guides/pre-commit.md b/docs/guides/pre-commit.md index c00ca29..2876413 100644 --- a/docs/guides/pre-commit.md +++ b/docs/guides/pre-commit.md @@ -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 @@ -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: @@ -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] diff --git a/docs/rules.md b/docs/rules.md index fdc50d4..2c4021a 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -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** @@ -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**