summaryrefslogtreecommitdiff
path: root/.githooks
diff options
context:
space:
mode:
authorDJ O'Leary <dijitol@proton.me>2026-06-26 18:04:09 +0200
committerDJ O'Leary <dijitol@proton.me>2026-06-26 18:04:09 +0200
commit6d8fb621d1e93b83786890d6d9cb6f0d8defa8ae (patch)
tree17c90d3984c114aa023600cc5bec6f6004b02243 /.githooks
parentad4ea5ca4bc9f7540ee1d6a4fa2d881709dc6459 (diff)
refactor!: invert repo directory structure
now is language first
Diffstat (limited to '.githooks')
-rwxr-xr-x.githooks/commit-msg15
-rwxr-xr-x.githooks/pre-push18
2 files changed, 33 insertions, 0 deletions
diff --git a/.githooks/commit-msg b/.githooks/commit-msg
new file mode 100755
index 0000000..1c1c287
--- /dev/null
+++ b/.githooks/commit-msg
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+# Commit message hook - enforce conventional commit format
+
+commit_regex='^(feat|fix|docs|style|refactor|test|chore)(\(.+\))?: .{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"
+ echo "Example: feat(auth): add user login functionality"
+ echo ""
+ echo "Your message: $(cat $1)"
+ exit 1
+fi
diff --git a/.githooks/pre-push b/.githooks/pre-push
new file mode 100755
index 0000000..51a8761
--- /dev/null
+++ b/.githooks/pre-push
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Pre-push hook - run tests before pushing
+
+set -e
+
+echo "๐Ÿงช Running tests before push..."
+
+# Run the full test suite
+task test
+
+if [ $? -eq 0 ]; then
+ echo "โœ… All tests passed! Push allowed."
+ exit 0
+else
+ echo "โŒ Tests failed! Push blocked."
+ echo "Fix the failing tests before pushing."
+ exit 1
+fi