File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3+ # Define Color Codes
4+ LBLUE=' \033[00;34m'
5+ LRED=' \033[01;31m'
6+ RESTORE=' \033[0m'
7+ YELLOW=' \033[00;33m'
8+
39# list of Conventional Commits types
410cc_types=(" feat" " fix" )
511default_types=(" build" " chore" " ci" " docs" " ${cc_types[@]} " " perf" " refactor" " revert" " style" " test" )
@@ -34,25 +40,25 @@ if grep -Eq "$pattern" "$msg_file"; then
3440 exit 0
3541fi
3642
37- echo " [ Commit message] $ ( cat " $msg_file " ) "
38- echo "
43+ echo -e " ${LRED} [Bad Commit message] >> ${RESTORE} \" $ ( cat " $msg_file " ) \" "
44+ echo -e " ${YELLOW}
3945Your commit message does not follow Conventional Commits formatting
40- https://www.conventionalcommits.org/
46+ ${LBLUE} https://www.conventionalcommits.org/${YELLOW}
4147
4248Conventional Commits start with one of the below types, followed by a colon,
43- followed by the commit message:
49+ followed by the commit message:${RESTORE}
4450
4551 $( IFS=' ' ; echo " ${types[*]} " )
4652
47- Example commit message adding a feature:
53+ ${YELLOW} Example commit message adding a feature:${RESTORE}
4854
4955 feat: implement new API
5056
51- Example commit message fixing an issue:
57+ ${YELLOW} Example commit message fixing an issue:${RESTORE}
5258
5359 fix: remove infinite loop
5460
55- Optionally, include a scope in parentheses after the type for more context:
61+ ${YELLOW} Optionally, include a scope in parentheses after the type for more context:${RESTORE}
5662
5763 fix(account): remove infinite loop
5864"
You can’t perform that action at this time.
0 commit comments