summaryrefslogtreecommitdiff
path: root/.githooks/commit-msg
diff options
context:
space:
mode:
authorDJ O'Leary <dijitol@proton.me>2026-07-08 01:06:20 +0200
committerDJ O'Leary <dijitol@proton.me>2026-07-08 01:06:20 +0200
commit4d088c9354c17c58478cf121349a314b4e0dd322 (patch)
tree4ad0635107bd4ec741ab82fd738662bc32ae073b /.githooks/commit-msg
parent970b9f872254612b673c3a09579ed902cade3c99 (diff)
set up and add sync package
Diffstat (limited to '.githooks/commit-msg')
-rwxr-xr-x.githooks/commit-msg15
1 files changed, 15 insertions, 0 deletions
diff --git a/.githooks/commit-msg b/.githooks/commit-msg
new file mode 100755
index 0000000..33d6a5f
--- /dev/null
+++ b/.githooks/commit-msg
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+# Commit message hook - enforce conventional commit format (optional)
+
+commit_regex='^(feat|fix|docs|style|refactor|test|chore|build|ci|perf)(\(.+\))?!?: .{1,50}|^fixup!'
+
+if ! grep -qE "$commit_regex" "$1"; then
+ echo "❌ Invalid commit message format!"
+ echo ""
+ echo "Format: type(scope): description"
+ echo "Types: feat, fix, docs, style, refactor, test, chore, build, ci, perf"
+ echo "Example: feat(auth): add user login functionality"
+ echo ""
+ echo "Your message: $(cat $1)"
+ exit 1
+fi