File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,20 @@ if ! command -v git &>/dev/null; then
2020 throw " git not installed."
2121fi
2222
23+ # Retrieve git email.
24+ GIT_EMAIL=$( git config user.email)
25+
26+ # Check if email is set.
27+ if [ -z " $GIT_EMAIL " ]; then
28+ throw " Git email is not set."
29+ fi
30+
31+ # Validate email using a regex.
32+ # This regex matches a basic email pattern.
33+ if ! [[ " $GIT_EMAIL " =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\. [A-Za-z]{2,}$ ]]; then
34+ throw " Git email '$GIT_EMAIL ' is not valid."
35+ fi
36+
2337# 1. Sleep for a random number of milliseconds
2438# The time interval is important to reduce unintended network traffic.
2539(( CURRENT_STEP++ ))
Original file line number Diff line number Diff line change @@ -300,6 +300,11 @@ done
300300 add_warning 1 " Commit subject should use imperative mood"
301301 fi
302302
303+ # 7d. Alert if the commit subject uses the pattern "Implement of ..."
304+ if [[ " ${COMMIT_SUBJECT_TO_PROCESS} " =~ ^(Implement| Realize| Update| Finish| Code)[[:space:]]+of[[:space:]]+ ]]; then
305+ add_warning 1 " Avoid using 'of' immediately after the verb"
306+ fi
307+
303308 # 8. Use the body to explain what and why vs. how
304309 # ------------------------------------------------------------------------------
305310
You can’t perform that action at this time.
0 commit comments