Skip to content

Commit 7147d44

Browse files
add(doc)[rel]: document default ignores
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent a9dfdb9 commit 7147d44

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ Conventions visible in the code:
147147
without `allowed` is flexible (anything between the delimiters).
148148
- Enclosure order is positional: each `[[commit.enclosures]]` entry
149149
may appear at most once, in declaration order.
150+
- Machine-generated headers — merges, reverts, `fixup!`/`squash!`/
151+
`amend!`, semver release bumps — exit 0 without linting
152+
(`src/ignore.rs`, mirroring commitlint's default ignores) unless
153+
`default-ignores = false` is set in `[commit]`.
150154
- `ExtraContext::new` sorts keywords/modifiers longest-first so that
151155
e.g. `!!` wins over `!`. Any new token class with overlapping
152156
prefixes needs the same treatment.

crates/atypical-commit/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ keywords = ["add", "rem", "ref", "fix", "undo", "release"]
4242
modifiers = ["?", "!", "!!"]
4343
separator = ":"
4444
modifier-sequence = "pre" # before the enclosures, or "post"
45+
default-ignores = true # skip machine-generated headers
4546

4647
# Scopes; omit `allowed` to accept anything between the delimiters.
4748
[[commit.enclosures]]
@@ -57,6 +58,24 @@ allowed = [
5758
]
5859
```
5960

61+
### Default ignores
62+
63+
Headers that git and forges generate on their own are exempt from
64+
linting, mirroring [commitlint's default
65+
ignores](https://commitlint.js.org/reference/configuration.html#defaultignores):
66+
67+
- merges: `Merge pull request ...`, `Merge branch '...'`,
68+
`Merge tag '...'`, `Merge x into y`,
69+
`Merge remote-tracking branch '...'`, `Merged x in(to) y`,
70+
`Merged PR 1: ...`, `Automatic merge ...`, `Auto-merged x into y`
71+
- reverts and reapplies: `Revert "..."`, `Reapply "..."`
72+
- autosquash markers: `fixup! ...`, `squash! ...`, `amend! ...`
73+
- release bumps: a semver version, optionally behind a `chore:`
74+
prefix and a `[skip ci]`-style marker, e.g. `chore(release): v1.2.3`
75+
76+
Set `default-ignores = false` in the `[commit]` section to lint these
77+
like any other header.
78+
6079
### As a `commit-msg` hook
6180

6281
With [husky](https://typicode.github.io/husky/), in `.husky/commit-msg`:

0 commit comments

Comments
 (0)