Commit 8c15551
committed
test(hooks): add CLAUDE.md filename-reference regression coverage
Issue #608 reports the commit-msg validator falsely rejected legitimate
file references like "update CLAUDE.md routing index". The active
three-pattern attribution regex (introduced for #480) actually already
allows these — the original substring "CLAUDE" check has been gone for
a while — but the test suite never asserted the filename-allow surface
explicitly, so the behavior was undocumented and at risk of regression.
This commit closes that gap by adding two test groups to both layered
test files (PreToolUse commit-message-guard and the git commit-msg hook):
1. Filename references allowed (issue #608)
- "docs: update CLAUDE.md routing index"
- "fix: correct CLAUDE.local.md gitignore path"
- "refactor: move CLAUDE config loader" (narrative inline)
- "chore: bump CLAUDE.md version field" (mid-subject)
- "docs(claude): clarify routing in CLAUDE.md" (scope + filename)
2. Known reject forms still blocked (issue #608)
- "feat: generated with Claude" (prose pattern)
- "fix: created by Anthropic team" (prose pattern)
- "docs: written using Claude assistance" (prose pattern)
The validator library hooks/lib/validate-commit-message.sh is unchanged;
no behavior shift, only freshly-asserted regression coverage.
global/commit-settings.md gains a one-line clarification stating that
filename and narrative references to the project root config are
allowed, with a pointer to the three-pattern design comment in the
validator library for the precise rules.
Closes #6081 parent 414ed98 commit 8c15551
3 files changed
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
91 | 108 | | |
92 | 109 | | |
93 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
106 | 126 | | |
107 | 127 | | |
108 | 128 | | |
| |||
0 commit comments