@@ -19,6 +19,7 @@ declare -a CHORES=()
1919declare -a REFACTORS=()
2020declare -a DOCS=()
2121declare -a TESTS=()
22+ declare -a PERFS=()
2223declare -a OTHERS=()
2324
2425# Function to process a commit part
@@ -53,6 +54,11 @@ process_commit_part() {
5354 local message=$( echo " $part " | sed ' s/docs([^)]*)//' )
5455 DOCS+=(" **${scope} **${message} " )
5556 return 0
57+ elif [[ " $part " == * " perf(" * ]]; then
58+ local scope=$( echo " $part " | sed -n ' s/perf(\([^)]*\)).*/\1/p' )
59+ local message=$( echo " $part " | sed ' s/perf([^)]*)//' )
60+ PERFS+=(" **${scope} **${message} " )
61+ return 0
5662 elif [[ " $part " =~ tests? \( ]]; then
5763 # Support both test(scope) and tests(scope)
5864 local scope=$( echo " $part " | sed -E -n ' s/tests?\(([^)]*)\).*/\1/p' )
@@ -78,7 +84,7 @@ while IFS= read -r line; do
7884 fi
7985
8086 # Split the commit message into parts based on conventional commit keywords
81- parts=$( echo " $line " | sed -E ' s/(fix\(|feat\(|chore\(|refactor\(|docs\(|tests?\()/\n\1/g' )
87+ parts=$( echo " $line " | sed -E ' s/(fix\(|feat\(|perf\(| chore\(|refactor\(|docs\(|tests?\()/\n\1/g' )
8288
8389 while IFS= read -r part; do
8490 # Trim leading and trailing whitespace without xargs
@@ -131,6 +137,11 @@ if [ ${#TESTS[@]} -gt 0 ]; then
131137 printf " * %s\n" " ${TESTS[@]} "
132138fi
133139
140+ if [ ${# PERFS[@]} -gt 0 ]; then
141+ echo -e " \n### ⚡ Performance"
142+ printf " * %s\n" " ${PERFS[@]} "
143+ fi
144+
134145if [ ${# OTHERS[@]} -gt 0 ]; then
135146 echo -e " \n### Other Changes"
136147 printf " * %s\n" " ${OTHERS[@]} "
0 commit comments