This project has some Git hooks included inside the git-hooks folder.
-
Install Git Hooks:
- Run the
clean
task to automatically install or update hooks:./gradlew clean
- Run the
-
Commit-Msg Hook:
- Ensures commit messages include an issue number (e.g.,
#123
or[ #123 ]
). - Blocks commits with invalid messages.
- Ensures commit messages include an issue number (e.g.,
Fix login issue #123
[ #456 ] Refactor module
Fix login issue
(No issue number).Updated README 123
(Missing#
prefix).
-
Improving Traceability:
- The
commit-msg
hook enforces commit message standards, making it easier to link commits to specific issues.
- The
-
Automating Hook Installation:
- Integrating hook installation with the
clean
task reduces manual steps and ensures hooks are always up-to-date.
- Integrating hook installation with the
project-root/
├── .git/
│ ├── hooks/
│ ├── pre-commit
│ ├── pre-push
│ ├── commit-msg
├── build.gradle.kts
├── git-hooks/
│ ├── pre-commit-unix.sh
│ ├── pre-commit-windows.sh
│ ├── pre-push-unix.sh
│ ├── pre-push-windows.sh
│ ├── commit-msg-unix.sh
│ ├── commit-msg-windows.sh