Skip to content

Commit 219a27c

Browse files
chore: adding git hooks
1 parent 7d9f181 commit 219a27c

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.githooks/commit-msg

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
commit_msg=$(head -1 "$1")
4+
5+
if ! echo "$commit_msg" | grep -qE '^(feat|fix|chore|docs|ci|test|refactor|perf|build|style|revert)(\(.+\))?(!)?: .+'; then
6+
echo "ERROR: Commit message must follow Conventional Commits format"
7+
echo ""
8+
echo " <type>[optional scope][!]: <description>"
9+
echo ""
10+
echo " Types: feat, fix, chore, docs, ci, test, refactor, perf, build, style, revert"
11+
echo ""
12+
echo " Examples:"
13+
echo " feat: add dashboard endpoints"
14+
echo " fix(models): handle null chart_settings"
15+
echo " feat!: rename VantageSDK to VantageClient"
16+
echo ""
17+
exit 1
18+
fi

CONTRIBUTORS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
## Development Setup
44

5-
Install the sdk locally and run tests when you finish making changes:
5+
```bash
6+
just setup
7+
```
8+
9+
This configures git hooks that enforce [Conventional Commits](https://www.conventionalcommits.org/) on commit messages (see [Releases](#releases)).
10+
11+
To run all checks (format, lint, typecheck, test):
612

713
```bash
814
uv run nox

justfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ typecheck-tests:
3737

3838
check: format lint typecheck test
3939

40+
# --- Setup ---
41+
42+
setup:
43+
git config core.hooksPath .githooks
44+
4045
# --- Code Generation ---
4146

4247
generate-models:

0 commit comments

Comments
 (0)