You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bd15226
Browse filesBrowse the repository at this point in the historyBrowse files
v2.16.0 opened a rule range the site had no home for, so the reference
pages had no entry for either feature it shipped. This brings them into
step.
## What changed
**`docs/rules.md`** — sections for the four new rules:
| Rule | Check | Config |
|---|---|---|
| CC401 | `tag` | `[tag] regex` |
| CC302 | `file-size` | `[files] max_size` |
| CC303 | `file-pattern` | `[files] prohibited_patterns` |
| CC304 | `path-length` | `[files] max_path_length` |
`CC3xx` now covers push **and** files, and `CC4xx` opens for tags — the
range table and the rule index both say so.
**`docs/configuration.md`** — the four new options with their defaults,
alongside their environment-variable and CLI forms.
**`docs/changelog.md`** — the v2.16.0 entry, dated 2026-08-31 to match
its PyPI upload, plus a Highlights row.
**Install pins** — five `rev:` snippets move to v2.16.0. Blog posts are
left alone on purpose.
## One test change, and why it was unavoidable
`_OPTIONS_ROW` recognised only `commit`, `branch` and `push` sections,
so a `[files]` or `[tag]` row could never be seen as documented —
`test_every_runtime_option_is_documented` would fail no matter what the
page said. It now reads those sections too.
The second half is subtler. `tag.regex` defaults to the SemVer pattern,
which contains alternation — a `|`. A markdown table cell cannot carry a
raw pipe, and the old non-greedy match stopped at the first one
regardless. The cell now escapes its pipes and the comparison unescapes
them before checking against the runtime. Without that, **no option
whose default contains a pipe could ever be documented**, which is a gap
the new rule happened to expose rather than one it created.
## Verification
Against the released package, as AGENTS.md requires — not a checkout of
`main`:
```console
$ python -m pip install --no-cache-dir --upgrade pytest commit-check==2.16.0
$ python -m pytest tests/ -q
9 passed
```
This was prepared before v2.16.0 was published, when
`test_pinned_revisions_match_the_released_version` was the one red test
— the case AGENTS.md allows for pins written ahead of the tag. The
release is out now and it passes, so the suite is fully green.
Copy file name to clipboardExpand all lines: docs/changelog.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ below and to the page that documents the feature properly.
11
11
12
12
| Version | What changed | Documented in |
13
13
|---|---|---|
14
+
|[2.16.0](#v2160)| Tag name validation, and file size, path and pattern policies |[CC401](rules.md#cc401) · [CC302–CC304](rules.md#push-rules)|
14
15
|[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)|
15
16
|[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)|
16
17
|[2.14.0](#v2140)| CC003 judges imperative mood by a word's form, not by a list of verbs |[CC003](rules.md#cc003)|
@@ -26,6 +27,36 @@ below and to the page that documents the feature properly.
26
27
|[2.5.0](#v250)| Organization-wide config with `inherit_from`|[Integrations](guides/integrations.md#across-an-organization)|
27
28
|[2.0.0](#v200)| Configuration moved from YAML to TOML — breaking |[Migrating from v1](migration.md)|
28
29
30
+
## v2.16.0 (2026-08-31) { #v2160 }
31
+
32
+
### Added
33
+
34
+
***Tag names can be checked** — `--tag` (`-t`) validates the names of the tags
35
+
pointing at the commit under test against a pattern, defaulting to SemVer
36
+
with an optional leading `v`. GitHub can require a tag name to match a
37
+
regular expression only through its Enterprise-plan
@@ -274,3 +278,7 @@ the same thing twice, so read the description rather than the cell:
274
278
| branch | require_rebase_target | str | "" (no requirement) | Target branch for rebase requirement. If not set, no rebase validation is performed. |
275
279
| push | allow_force_push | bool | true | Allow force pushes. Set to `false` to block force pushes when used as a pre-push hook or with `--no-force-push`. |
276
280
| branch | ignore_authors | list[str] | [] (none ignored) | List of authors to ignore (i.e., always allow). |
281
+
| tag | regex | str | `^v?(?:0\|[1-9]\d*)\.(?:0\|[1-9]\d*)\.(?:0\|[1-9]\d*)(?:-(?:0\|[1-9]\d*\|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0\|[1-9]\d*\|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$` | Pattern a tag name must match. The default is the [official SemVer pattern](https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string) with an optional leading `v`, so both `v1.2.3` and `1.2.3` pass. An empty value disables the pattern match. |
282
+
| files | max_size | str | "" (disabled) | Largest a committed file may be, in bytes or with a `KB`/`MB`/`GB` suffix (binary units, so `5MB` is 5 × 1024²). Empty disables the rule. |
283
+
| files | prohibited_patterns | list[str] | [] (empty list) | fnmatch patterns a committed path may not match, e.g. `["*.pem", ".env", "id_rsa*"]`. A bare pattern also matches the file name at any depth. Matching is case-sensitive on every platform, like git pathspecs. Empty disables the rule. |
284
+
| files | max_path_length | int | 0 (disabled) | Longest a committed file path may be, in characters. `0` disables the rule. |
0 commit comments