Created
March 13, 2020 10:22
-
-
Save thinhdanggroup/6069f591d0ce034474f162ba6e0f0be6 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
error_msg="Aborting commit. Your commit must: | |
[SCOPE - which part of the source code is impacted]: <Short (72 chars or less) summary> | |
<The body, details explain what's this commit does?> | |
Issues: <Jira issue link>" | |
msg=$(cat $1) | |
regex="^\[.{1,30}\].{1,250}\n\n.{1,250}(\n\nIssues:.{0,20})?" | |
echo | |
echo =====ZAS Checker===== | |
echo Message: | |
echo $msg | |
echo ===================== | |
numOK=$(pcregrep -nMc "$regex" "$1") | |
error=0 | |
if [ $numOK -eq 0 ]; | |
then | |
echo "$error_msg" >&2 | |
echo ===================== | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment