From f7b0060d4b40731a4a61b9680fc816790ea231d9 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sun, 16 Aug 2026 12:20:04 +0000 Subject: [PATCH 1/2] docs: document the color and hyperlink controls that ship in v2.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v2.15.1 makes ANSI color TTY-aware and honours NO_COLOR, and nothing on the site said so: no changelog entry, no mention of NO_COLOR, FORCE_COLOR or FORCE_HYPERLINK anywhere. Adds the changelog entry with its Highlights row, crediting the contribution, and a Color and links section in the recipes documenting the detection and the three overriding variables. Install pins stay at v2.15.0 deliberately: the pin check compares them to the released version, and v2.15.1 is not published yet. When it is, that check flags the bump on its own — that is what it is for. --- docs/changelog.md | 16 ++++++++++++++++ docs/example.md | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index cad49ec..0e46c23 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -11,6 +11,7 @@ below and to the page that documents the feature properly. | Version | What changed | Documented in | |---|---|---| +| [2.15.1](#v2151) | Color and rule-ID links appear only where they render; `NO_COLOR` honoured | [Color and links](example.md#color-and-links) | | [2.15.0](#v2150) | `--rev` names the commit under test; skipped checks are named on stderr | [Command-line recipes](example.md#checking-a-range-of-commits) | | [2.14.0](#v2140) | CC003 judges imperative mood by a word's form, not by a list of verbs | [CC003](rules.md#cc003) | | [2.13.1](#v2131) | JSON output reports the checked value for passing checks | [Output for scripts and CI](example.md#output-for-scripts-and-ci) | @@ -25,6 +26,21 @@ below and to the page that documents the feature properly. | [2.5.0](#v250) | Organization-wide config with `inherit_from` | [Integrations](guides/integrations.md#across-an-organization) | | [2.0.0](#v200) | Configuration moved from YAML to TOML — breaking | [Migrating from v1](migration.md) | +## v2.15.1 (2026-08-16) { #v2151 } + +### Fixed + +* **ANSI color is emitted only where it renders** — a terminal gets color; + piped and redirected output (a CI log, a file, another tool) gets plain text + instead of escape codes. `NO_COLOR` ([no-color.org](https://no-color.org)) + set to any non-empty value disables color everywhere, and `FORCE_COLOR` + overrides the detection in both directions — `0` off, anything else on — + outranking `NO_COLOR`, the same way the wider tooling ecosystem resolves + the pair. Contributed by [@larsch](https://github.com/larsch). + See PRs [#551](https://github.com/commit-check/commit-check/pull/551) and + [#552](https://github.com/commit-check/commit-check/pull/552), and + [Color and links](example.md#color-and-links). + ## v2.15.0 (2026-08-13) { #v2150 } ### Added diff --git a/docs/example.md b/docs/example.md index 187339d..be6e359 100644 --- a/docs/example.md +++ b/docs/example.md @@ -190,6 +190,22 @@ and how CLI, environment and file settings override each other. $ commit-check -m --dry-run ``` +### Color and links + +Output adapts to where it is going. A terminal gets ANSI color, and on +terminals that render OSC 8 hyperlinks the rule ID is itself a link to its +documentation. Piped or redirected output — a CI log, a file — gets plain +text with a `Docs:` line instead, so nothing is lost and no escape codes +leak into places that read them as noise. + +To override the detection: + +| Variable | Effect | +| --- | --- | +| `NO_COLOR=1` | no color, wherever it runs ([no-color.org](https://no-color.org)) | +| `FORCE_COLOR=1` / `FORCE_COLOR=0` | color on or off, outranking everything else | +| `FORCE_HYPERLINK=1` / `FORCE_HYPERLINK=0` | linked rule IDs on or off | + ### Checking a range of commits `--rev` makes each commit addressable without checking it out or piping its From a1f16e064ff412f14ff629911cc90c8223dd2d25 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 16 Aug 2026 12:30:25 +0000 Subject: [PATCH 2/2] docs: bump install pins to v2.15.1 now that it is released The docs-sync test compares every rev: pin outside the blog against the installed commit-check version. v2.15.1 is now on PyPI, so the pins in configuration.md, example.md, guides/integrations.md and index.md were stale at v2.15.0. --- docs/configuration.md | 2 +- docs/example.md | 2 +- docs/guides/integrations.md | 4 ++-- docs/index.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index ed1cf0c..531fd7a 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -167,7 +167,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.15.0 + rev: v2.15.1 hooks: - id: check-message args: diff --git a/docs/example.md b/docs/example.md index be6e359..73390ff 100644 --- a/docs/example.md +++ b/docs/example.md @@ -131,7 +131,7 @@ pushed: ```yaml title=".pre-commit-config.yaml" repos: - repo: https://github.com/commit-check/commit-check - rev: v2.15.0 + rev: v2.15.1 hooks: - id: check-no-force-push stages: [pre-push] diff --git a/docs/guides/integrations.md b/docs/guides/integrations.md index 8a576bb..a5816f0 100644 --- a/docs/guides/integrations.md +++ b/docs/guides/integrations.md @@ -23,7 +23,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.15.0 + rev: v2.15.1 hooks: - id: check-message - id: check-branch @@ -70,7 +70,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.15.0 + rev: v2.15.1 hooks: - id: check-message args: diff --git a/docs/index.md b/docs/index.md index af331fd..370ca21 100644 --- a/docs/index.md +++ b/docs/index.md @@ -36,7 +36,7 @@ whatever your AI agent is committing on your behalf. ```yaml title=".pre-commit-config.yaml" repos: - repo: https://github.com/commit-check/commit-check - rev: v2.15.0 + rev: v2.15.1 hooks: - id: check-message - id: check-branch