Skip to content

chore: add branch naming validation hook#21

Merged
john-zhh merged 1 commit intomainfrom
chore/add-branch-naming-hook
Mar 9, 2026
Merged

chore: add branch naming validation hook#21
john-zhh merged 1 commit intomainfrom
chore/add-branch-naming-hook

Conversation

@john-zhh
Copy link
Contributor

@john-zhh john-zhh commented Mar 9, 2026

Summary

Add Git pre-commit hook to enforce branch naming conventions for the GoZen repository.

Changes

  • Added scripts/pre-commit-hook.sh - Pre-commit hook script that validates branch names
  • Added scripts/install-hooks.sh - Installation script for Git hooks
  • Updated README.md - Added instructions for installing Git hooks and branch naming convention

Branch Naming Convention

All feature branches must follow the format: <type>/<description>

Allowed types: feat, fix, docs, refactor, test, chore, perf, ci, build, revert

Examples:

  • feat/user-authentication
  • fix/payment-processing-bug
  • docs/api-documentation

Protected branches (exempt from validation): main, master, develop

Installation

New contributors should run:

./scripts/install-hooks.sh

Testing

✅ Tested on current branch chore/add-branch-naming-hook - commit succeeded
✅ Hook correctly validates branch name format
✅ Protected branches (main) are exempt from validation

@john-zhh john-zhh merged commit 10cb81d into main Mar 9, 2026
2 checks passed
@john-zhh john-zhh deleted the chore/add-branch-naming-hook branch March 9, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant