diff --git a/docs/changelog.md b/docs/changelog.md index 4d4dbbf..d51e41f 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -11,6 +11,7 @@ page that documents it. | Version | What changed | Documented in | |---|---|---| +| [2.23.1](#v2231) | git's `Revert "..."` and `Reapply "..."` commits pass; `revert` is a default type again; several failures quote the message once | [CC001](rules.md#cc001) · [CC004](rules.md#cc004) · [CC007](rules.md#cc007) | | [2.23.0](#v2230) | `commit-check-ci` checks a whole merge or pull request in one GitLab CI job or Bitbucket Pipelines step | [GitLab CI, Bitbucket and Azure Pipelines](guides/other-ci.md) | | [2.22.0](#v2220) | `--pr-title` checks a pull or merge request title on any CI; the rebase check works in Bitbucket pull request steps and GitLab merged results pipelines | [GitLab CI, Bitbucket and Azure Pipelines](guides/other-ci.md#merge-request-title-and-description) · [CC202](rules.md#cc202) | | [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) | @@ -44,6 +45,18 @@ 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.23.1 (2026-11-20) { #v2231 } + +### Changed + +* When more than one message rule fails, the message is quoted once above the failures, with the lines they point at marked, and each failure names only its rule. One failure, `--compact` and the JSON output are unchanged. ([#719](https://github.com/commit-check/commit-check/pull/719)) +* `commit-check` run without a check prints a short intro: the commands to start with, the config file and the docs. ([#718](https://github.com/commit-check/commit-check/pull/718)) + +### Fixed + +* CC001 accepts the `Reapply "..."` subject git writes when a revert is reverted, as it accepts `Revert "..."`; CC004 and CC005 do not measure either, and CC007 covers both. ([CC001](rules.md#cc001), [#724](https://github.com/commit-check/commit-check/pull/724)) +* `revert` is a default commit type again, as it was in v1, for a revert written as `revert: ...`. ([Every option](configuration.md#every-option), [#724](https://github.com/commit-check/commit-check/pull/724)) + ## v2.23.0 (2026-11-19) { #v2230 } ### Added diff --git a/docs/compare/tools.md b/docs/compare/tools.md index 3d7badb..df81043 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.23.0 + rev: v2.23.1 hooks: - id: check-message ``` diff --git a/docs/configuration.md b/docs/configuration.md index 85671cb..b882cac 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.23.0 + rev: v2.23.1 hooks: - id: check-message args: @@ -400,11 +400,11 @@ 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. 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. 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"] | Allowed commit types when conventional_commits is true. | +| `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. | +| `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 revert commits. | +| `allow_revert_commits` | bool | true | Allow the `Revert "..."` and `Reapply "..."` commits `git revert` writes. | | `allow_empty_commits` | bool | true | Allow empty commits. | | `allow_fixup_commits` | bool | true | Allow fixup commits: `fixup!`, `squash!` and `amend!` subjects. | | `allow_wip_commits` | bool | true | Allow work-in-progress commits (e.g., "WIP: "). | diff --git a/docs/example.md b/docs/example.md index de4dfb2..7a5cdec 100644 --- a/docs/example.md +++ b/docs/example.md @@ -60,7 +60,7 @@ $ echo "updated the parser" | commit-check -m ✖ CC001 message failed: updated the parser The commit message should follow Conventional Commits. See https://www.conventionalcommits.org - Suggest: Use (): , where is one of: feat, fix, docs, style, refactor, test, chore, perf, build, ci + Suggest: Use (): , where is one of: feat, fix, docs, style, refactor, test, chore, perf, build, ci, revert Docs: https://commit-check.com/rules/#cc001 ``` @@ -186,7 +186,7 @@ pushed: ```yaml title=".pre-commit-config.yaml" repos: - repo: https://github.com/commit-check/commit-check - rev: v2.23.0 + rev: v2.23.1 hooks: - id: check-no-force-push stages: [pre-push] diff --git a/docs/getting-started.md b/docs/getting-started.md index 1b8e11e..1a1534e 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -72,7 +72,7 @@ $ commit-check --message ✖ CC001 message failed: updated the parser The commit message should follow Conventional Commits. See https://www.conventionalcommits.org - Suggest: Use (): , where is one of: feat, fix, docs, style, refactor, test, chore, perf, build, ci + Suggest: Use (): , where is one of: feat, fix, docs, style, refactor, test, chore, perf, build, ci, revert Docs: https://commit-check.com/rules/#cc001 ``` diff --git a/docs/guides/other-ci.md b/docs/guides/other-ci.md index abdb2de..a95c919 100644 --- a/docs/guides/other-ci.md +++ b/docs/guides/other-ci.md @@ -35,7 +35,7 @@ Branch Commit ccdfc043 added the login form ✖ CC001 message failed: added the login form The commit message should follow Conventional Commits. See https://www.conventionalcommits.org - Suggest: Use (): , where is one of: feat, fix, docs, style, refactor, test, chore, perf, build, ci + Suggest: Use (): , where is one of: feat, fix, docs, style, refactor, test, chore, perf, build, ci, revert Docs: https://commit-check.com/rules/#cc001 Commit 20119d2e fix: trim the user name diff --git a/docs/guides/pre-commit.md b/docs/guides/pre-commit.md index 5a42abd..1a2fc4b 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.23.0 + rev: v2.23.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.23.0 + rev: v2.23.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.23.0 + rev: v2.23.1 hooks: - id: check-message args: [--fix] diff --git a/docs/migration.md b/docs/migration.md index 355144a..70351a0 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -74,24 +74,15 @@ ID and a link to the rule's documentation. "Restating the built-in behaviour" is nearly true, not exactly true, and the gap is silent — the shorter file above accepts slightly less than the - v1 one it replaces. Two types in that v1 example are missing from the v2 - defaults: + v1 one it replaces. One type in that v1 example is missing from the v2 + defaults: `task` as a branch type. `task/CC-42` passed under v1 and is + rejected by the default `allow_branch_types`. (`revert` as a commit type + is in the v2 defaults, as it was in v1.) - - `revert` as a commit type. `revert: drop the cache` passed under v1 and - is rejected by the default `allow_commit_types`. (Unrelated to - `allow_revert_commits`, which governs Git's own `Revert "..."` commits - and is on by default.) - - `task` as a branch type. `task/CC-42` passed under v1 and is rejected by - the default `allow_branch_types`. - - Keep them by naming the list you want, remembering that setting either - option replaces the default rather than adding to it: + Keep it by naming the list you want, remembering that setting the option + replaces the default rather than adding to it: ```toml - [commit] - allow_commit_types = ["build", "chore", "ci", "docs", "feat", "fix", - "perf", "refactor", "revert", "style", "test"] - [branch] allow_branch_types = ["bugfix", "chore", "feature", "hotfix", "release", "task"] ``` diff --git a/docs/rules.md b/docs/rules.md index 176359f..233b251 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -170,6 +170,12 @@ whether merge commits are allowed at all is [CC006](#cc006)'s call. A subject someone typed that merely starts with `Merge `, such as `Merge the parser rewrite`, is judged like any other. +The same goes for the subjects `git revert` writes: `Revert ""`, and +`Reapply ""` when the commit reverted is itself a revert. GitHub's +and GitLab's revert buttons write the same `Revert "` subject. Whether reverts +are allowed at all is [CC007](#cc007)'s call. A revert written by hand takes +the `revert` type, which is in the default list: `revert: drop the cache`. + **Why is this bad?** A free-form subject can only be read by a human. A structured one can be read by @@ -327,6 +333,8 @@ same root cause. * 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. +* The `Revert "..."` and `Reapply "..."` subjects `git revert` writes, which + add nine characters to a subject that already fit. CC005 skips them too. ### subject-min-length (CC005) { #cc005 } @@ -398,7 +406,8 @@ git config --global pull.rebase true **What it does** -Rejects the `Revert "..."` commits that `git revert` generates. +Rejects the `Revert "..."` commits that `git revert` generates, and the +`Reapply "..."` it writes when the commit reverted is itself a revert. **Why is this bad?**