diff --git a/.githooks/commit-msg b/.githooks/commit-msg index dd14401..41992ad 100644 --- a/.githooks/commit-msg +++ b/.githooks/commit-msg @@ -5,7 +5,6 @@ commit_msg=$(cat "$commit_msg_file") if echo "$commit_msg" | grep -Eq "^(feat|fix|refactor|perf|style|test|docs|build|chore|revert): .+"; then if echo "$commit_msg" | grep -Eq "^(ref|close):\sN25B-.+"; then - echo "🎉 commit message is Valid" exit 0 else echo "❌ Commit message invalid! Must end with [ref/close]: N25B-000" diff --git a/.githooks/pre-commit b/.githooks/pre-commit index ed801d8..7e94937 100644 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -9,7 +9,6 @@ fi # allowed pattern if echo "$branch" | grep -Eq "^(feat|fix|refactor|perf|style|test|docs|build|chore|revert)\/\w+(-\w+){0,5}$"; then - echo "✅ Branch name valid: $branch" exit 0 else echo "❌ Invalid branch name: $branch" diff --git a/README.md b/README.md index e7cfd21..eff576a 100644 --- a/README.md +++ b/README.md @@ -88,3 +88,16 @@ Then resume the steps from above. cd src python -m robot_interface.main ``` + +## GitHooks + +To activate automatic commits/branch name checks run: + +```shell +git config --local core.hooksPath .githooks +``` + +If your commit fails its either: +branch name != /description-of-branch , +commit name != : description of the commit. + : N25B-Num's