Skip to content

Commit e2a206d

Browse files
Add Copilot noreply bot email test coverage and README git hooks install instructions
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
1 parent 0ef56d0 commit e2a206d

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Config Files
22

3+
## Git Hooks
4+
5+
Strips AI-generated trailers (e.g. `Co-authored-by: Copilot`) from commit messages automatically.
6+
7+
**macOS / Linux:**
8+
9+
```bash
10+
bash git-hooks/install.sh
11+
```
12+
13+
**Windows (PowerShell):**
14+
15+
```powershell
16+
powershell -ExecutionPolicy Bypass -File git-hooks/install.ps1
17+
```
18+
319
## Winget Config instructions
420

521
1. Take the desired configuration scripts from the [winget_configurations folder](./winget_configurations)

git-hooks/tests/commit-msg.Tests.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,13 @@ Describe 'Remove-AITrailers' {
112112
$result = Remove-AITrailers -Lines $lines
113113
$result | Should -Not -Match 'co-authored-by'
114114
}
115+
116+
It 'removes Co-authored-by: Copilot with GitHub noreply bot email' {
117+
$lines = @('Fix bug', '', 'Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>')
118+
$result = @(Remove-AITrailers -Lines $lines)
119+
$result | Should -Not -Match 'Co-authored-by'
120+
$result[0] | Should -Be 'Fix bug'
121+
}
115122
}
116123

117124
Context 'Claude / Anthropic Co-authored-by is removed' {
@@ -384,6 +391,13 @@ Describe 'commit-msg bash hook (end-to-end)' -Skip:($IsWindows -or -not (Get-Com
384391
$result.Trim() | Should -Be 'Fix bug'
385392
}
386393

394+
It 'removes Copilot trailer with GitHub noreply bot email' {
395+
$content = "Fix bug`n`nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>`n"
396+
$result = Invoke-BashHook $content
397+
$result | Should -Not -Match 'Co-authored-by'
398+
$result.Trim() | Should -Be 'Fix bug'
399+
}
400+
387401
It 'removes Claude trailer by email domain' {
388402
$content = "Fix bug`n`nCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>`n"
389403
$result = Invoke-BashHook $content

0 commit comments

Comments
 (0)