chore: lefthook make branch names as warning

This commit is contained in:
Nikhil Sonti
2026-02-26 17:26:04 -08:00
parent 618b35b460
commit 00096752b5

View File

@@ -44,13 +44,12 @@ pre-push:
exit 0
fi
if [[ ! "$branch" =~ ^(feat|fix|bugfix|hotfix|release|docs|refactor|test|chore|experiment)/[a-z0-9-]+$ ]]; then
echo "Branch name '$branch' doesn't match required format."
echo "Use: <type>/<short-description>"
echo "Types: feat, fix, bugfix, hotfix, release, docs, refactor, test, chore, experiment"
echo "Example: feat/add-auth, fix/login-crash"
echo "⚠️ Warning: Branch name '$branch' doesn't match recommended format."
echo " Use: <type>/<short-description>"
echo " Types: feat, fix, bugfix, hotfix, release, docs, refactor, test, chore, experiment"
echo " Example: feat/add-auth, fix/login-crash"
echo ""
echo "To rename your branch:"
echo " git branch -m <new-name>"
echo " git push -u origin <new-name>"
exit 1
echo " To rename your branch:"
echo " git branch -m <new-name>"
echo " git push -u origin <new-name>"
fi