Skip to content

Commit f48aff1

Browse files
committed
Add shareable commit-msg hook for contributors
1 parent af33bc2 commit f48aff1

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.githooks/commit-msg

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
# Prevent commit messages from containing AI assistant references
3+
4+
commit_msg_file="$1"
5+
commit_msg=$(cat "$commit_msg_file")
6+
7+
# Check for AI assistant references (case-insensitive)
8+
if echo "$commit_msg" | grep -iqE "(claude|Generated with.*Code|Co-Authored-By:.*(Claude|Anthropic))"; then
9+
echo "ERROR: Commit message contains AI assistant references."
10+
echo "Please remove references to AI assistants from your commit message."
11+
echo ""
12+
echo "Your message:"
13+
echo "$commit_msg"
14+
exit 1
15+
fi
16+
17+
exit 0

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ Thank you for your interest in contributing! This document provides guidelines f
3535

3636
## Development Setup
3737

38+
### Initial Setup
39+
40+
After cloning the repository, configure git to use the project's commit hooks:
41+
42+
```bash
43+
git config core.hooksPath .githooks
44+
```
45+
46+
This enables the commit-msg hook that enforces commit message guidelines.
47+
3848
### Prerequisites
3949

4050
- Docker with buildx support

0 commit comments

Comments
 (0)