Skip to content

Commit 2c0fc8d

Browse files
author
Felix
committed
feat: allow underscore in scopes
1 parent 7e1ceac commit 2c0fc8d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

conventional-pre-commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ msg_file="$1"
2121
# join types with | to form regex ORs
2222
r_types="($(IFS='|'; echo "${types[*]}"))"
2323
# optional (scope)
24-
r_scope="(\([[:alnum:] \/-]+\))?"
24+
r_scope="(\([[:alnum:] \/-_]+\))?"
2525
# optional breaking change indicator and colon delimiter
2626
r_delim='!?:'
2727
# subject line, body, footer

tests.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,18 @@ echo "$pass" | grep -Eq "\[main \(root-commit\) [[:alnum:]]{7}\] test: conventio
113113

114114
echo "$result"
115115

116+
echo "test underscore in scope"
117+
118+
setup
119+
120+
pass="$(git commit -m 'test(some_component): conventional-pre-commit')"
121+
122+
teardown
123+
124+
echo "$pass" | grep -Eq "\[main \(root-commit\) [[:alnum:]]{7}\] test\(some_component\): conventional-pre-commit"
125+
126+
(( result += "$?" ))
127+
128+
echo "$result"
129+
116130
exit "$result"

0 commit comments

Comments
 (0)