This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# regex to validate in commit msg | |
commit_regex='^(feat|fix|docs|refactor|style|test|ci)\([a-z](-|[[:alnum:]]|[[:space:]])+\) [A-Z]' | |
if ! grep -E "$commit_regex" "$1"; then | |
echo "" | |
echo -e "\033[0;31m[POLICY] Your message is not formatted correctly!\033[0m" >&2 | |
echo "" | |
echo "Message format must be like:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# regex to validate in commit msg | |
commit_regex='^(feat|fix|docs|refactor|style|test|ci)\([a-z](-|[[:alnum:]]|[[:space:]])+\) #[[:digit:]]+ [A-Z]' | |
if ! grep -E "$commit_regex" "$1"; then | |
echo "" | |
echo -e "\033[0;31m[POLICY] Your message is not formatted correctly!\033[0m" >&2 | |
echo "" | |
echo "Message format must be like:" |