Skip to content

Commit ddd6ae5

Browse files
committed
docs: list the tag and file hooks in the pre-commit guide
- The hook table gains check-files (CC302-CC304) and check-tag (CC401), pre-push hooks since 2.16.0 that the README already sends readers here for. - check-message and the App run CC001-CC016 since 2.18.0, not CC001-CC013. - A note says pre-commit runs no hook for a push that creates a ref without new commits, so a tag pushed on its own after its commit is never checked. Checked with pre-commit 4.6.2 at rev v2.18.3: check-files rejected a 4 KB file over max_size = "1KB", check-tag rejected release-2.0 pushed with its commit, and release-1.0 pushed alone on an already-pushed commit ran no hook. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013rE6bouKaJvsRyKA4tjqCb
1 parent 05e9091 commit ddd6ae5

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎docs/guides/github-app.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ way everywhere:
4747

4848
### Which rules
4949

50-
The App runs the commit message, author and branch rules — [CC001–CC013](../rules.md#commit-message-rules),
50+
The App runs the commit message, author and branch rules — [CC001–CC016](../rules.md#commit-message-rules),
5151
[CC101–CC102](../rules.md#author-rules) and [CC201–CC202](../rules.md#branch-rules) —
5252
with the commit's own branch as the branch under test. One thing it does not
5353
do: the push, file and tag rules ([CC301–CC304](../rules.md#push-rules),

‎docs/guides/pre-commit.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,24 @@ That is it. The next malformed commit message is rejected before it exists.
3636

3737
| Hook ID | Stage | Rules |
3838
|---|---|---|
39-
| `check-message` | `commit-msg` | [CC001–CC013](../rules.md#commit-message-rules) |
39+
| `check-message` | `commit-msg` | [CC001–CC016](../rules.md#commit-message-rules) |
4040
| `check-branch` | `pre-commit` | [CC201–CC202](../rules.md#branch-rules) |
4141
| `check-author-name` | `pre-commit` | [CC101](../rules.md#cc101) |
4242
| `check-author-email` | `pre-commit` | [CC102](../rules.md#cc102) |
4343
| `check-no-force-push` | `pre-push` | [CC301](../rules.md#cc301) |
44+
| `check-files` | `pre-push` | [CC302–CC304](../rules.md#push-rules) |
45+
| `check-tag` | `pre-push` | [CC401](../rules.md#cc401) |
4446

45-
`check-no-force-push` also needs its own install:
47+
The three `pre-push` hooks need their own install too:
4648

4749
```console
4850
$ pre-commit install --hook-type pre-push
4951
```
5052

53+
pre-commit runs no hook for a push that creates a ref without carrying new
54+
commits. So a new tag pushed on its own, when the commit it points at is
55+
already on the remote, is never seen by `check-tag`.
56+
5157
## Configuring without a TOML file
5258

5359
Options can be passed as hook arguments, which keeps everything in one file:

0 commit comments

Comments
 (0)