We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f49dee commit 883ba4dCopy full SHA for 883ba4d
conventional-pre-commit.sh
@@ -21,16 +21,16 @@ msg_file=$1
21
# join types with | to form regex ORs
22
r_types="($(IFS='|'; echo "${types[*]}"))"
23
# optional (scope)
24
-r_scope="(\([\w \/-]+\))?"
+r_scope="(\([[:alnum:] \/-]+\))?"
25
# optional breaking change indicator and colon delimiter
26
r_delim='!?:'
27
# subject line, body, footer
28
-r_subject=" [\w][\s\S]+"
+r_subject=" [[:alnum:]].+"
29
# the full regex pattern
30
pattern="^$r_types$r_scope$r_delim$r_subject$"
31
32
-# check commit message
33
-if grep -Pq "$pattern" "$msg_file"; then
+# Check if commit is conventional commit
+if grep -Eq "$pattern" "$msg_file"; then
34
exit 0
35
fi
36
0 commit comments