Skip to content

Commit

Permalink
Enhancement (generate): Fix regex patterns for matching commit messag…
Browse files Browse the repository at this point in the history
…es following categorized conventions
  • Loading branch information
joeltimothyoh committed May 20, 2024
1 parent 41e70a8 commit 477989c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function Changes-HashSubject-NoMerges-Categorized {
}
)
$commitHistoryUncategorized = $commitHistoryTrimmed | % {
if (!($_ -match "^[0-9a-f]+ (\s*\w+\s*\(\s*[a-zA-Z0-9_-]+\s*\)\s*:)(.+)")) {
if (!($_ -match "^[0-9a-f]+ (\s*\w+\s*)(\(*\s*[a-zA-Z0-9_-]+\s*\)*\s*):(.+)")) {
$_
}
}
Expand All @@ -69,7 +69,7 @@ function Changes-HashSubject-NoMerges-Categorized {
foreach ($c in $commitCategory) {
$isTitleOutputted = $false
$commitHistoryTrimmed | % {
if ($_ -match "^[0-9a-f]+ (\s*$($c['Name'])\s*\(\s*[a-zA-Z0-9_-]+\s*\)\s*:)(.+)") {
if ($_ -match "^[0-9a-f]+ (\s*$($c['Name'])\s*)(\(*\s*[a-zA-Z0-9_-]+\s*\)*\s*):(.+)") {
if (!$isTitleOutputted) {
@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function Changes-HashSubjectAuthor-NoMerges-Categorized {
}
)
$commitHistoryUncategorized = $commitHistoryTrimmed | % {
if (!($_ -match "^[0-9a-f]+ (\s*\w+\s*\(\s*[a-zA-Z0-9_-]+\s*\)\s*:)(.+)")) {
if (!($_ -match "^[0-9a-f]+ (\s*\w+\s*)(\(*\s*[a-zA-Z0-9_-]+\s*\)*\s*):(.+)")) {
$_
}
}
Expand All @@ -69,7 +69,7 @@ function Changes-HashSubjectAuthor-NoMerges-Categorized {
foreach ($c in $commitCategory) {
$isTitleOutputted = $false
$commitHistoryTrimmed | % {
if ($_ -match "^[0-9a-f]+ (\s*$($c['Name'])\s*\(\s*[a-zA-Z0-9_-]+\s*\)\s*:)(.+)") {
if ($_ -match "^[0-9a-f]+ (\s*$($c['Name'])\s*)(\(*\s*[a-zA-Z0-9_-]+\s*\)*\s*):(.+)") {
if (!$isTitleOutputted) {
@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function VersionDate-HashSubject-NoMerges-Categorized {
}
)
$commitHistoryUncategorized = $commitHistoryTrimmed | % {
if (!($_ -match "^[0-9a-f]+ (\s*\w+\s*\(\s*[a-zA-Z0-9_-]+\s*\)\s*:)(.+)")) {
if (!($_ -match "^[0-9a-f]+ (\s*\w+\s*)(\(*\s*[a-zA-Z0-9_-]+\s*\)*\s*):(.+)")) {
$_
}
}
Expand All @@ -69,7 +69,7 @@ function VersionDate-HashSubject-NoMerges-Categorized {
foreach ($c in $commitCategory) {
$isTitleOutputted = $false
$commitHistoryTrimmed | % {
if ($_ -match "^[0-9a-f]+ (\s*$($c['Name'])\s*\(\s*[a-zA-Z0-9_-]+\s*\)\s*:)(.+)") {
if ($_ -match "^[0-9a-f]+ (\s*$($c['Name'])\s*)(\(*\s*[a-zA-Z0-9_-]+\s*\)*\s*):(.+)") {
if (!$isTitleOutputted) {
@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function VersionDate-HashSubjectAuthor-NoMerges-Categorized {
}
)
$commitHistoryUncategorized = $commitHistoryTrimmed | % {
if (!($_ -match "^[0-9a-f]+ (\s*\w+\s*\(\s*[a-zA-Z0-9_-]+\s*\)\s*:)(.+)")) {
if (!($_ -match "^[0-9a-f]+ (\s*\w+\s*)(\(*\s*[a-zA-Z0-9_-]+\s*\)*\s*):(.+)")) {
$_
}
}
Expand All @@ -69,7 +69,7 @@ function VersionDate-HashSubjectAuthor-NoMerges-Categorized {
foreach ($c in $commitCategory) {
$isTitleOutputted = $false
$commitHistoryTrimmed | % {
if ($_ -match "^[0-9a-f]+ (\s*$($c['Name'])\s*\(\s*[a-zA-Z0-9_-]+\s*\)\s*:)(.+)") {
if ($_ -match "^[0-9a-f]+ (\s*$($c['Name'])\s*)(\(*\s*[a-zA-Z0-9_-]+\s*\)*\s*):(.+)") {
if (!$isTitleOutputted) {
@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function VersionDate-Subject-NoMerges-Categorized {
}
)
$commitHistoryUncategorized = $commitHistoryTrimmed | % {
if (!($_ -match "^(\s*\w+\s*\(\s*[a-zA-Z0-9_-]+\s*\)\s*:)(.+)")) {
if (!($_ -match "^(\s*\w+\s*)(\(*\s*[a-zA-Z0-9_-]+\s*\)*\s*):(.+)")) {
$_
}
}
Expand All @@ -69,7 +69,7 @@ function VersionDate-Subject-NoMerges-Categorized {
foreach ($c in $commitCategory) {
$isTitleOutputted = $false
$commitHistoryTrimmed | % {
if ($_ -match "^(\s*$($c['Name'])\s*\(\s*[a-zA-Z0-9_-]+\s*\)\s*:)(.+)") {
if ($_ -match "^(\s*$($c['Name'])\s*)(\(*\s*[a-zA-Z0-9_-]+\s*\)*\s*):(.+)") {
if (!$isTitleOutputted) {
@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function VersionDate-SubjectAuthor-NoMerges-Categorized {
}
)
$commitHistoryUncategorized = $commitHistoryTrimmed | % {
if (!($_ -match "^(\s*\w+\s*\(\s*[a-zA-Z0-9_-]+\s*\)\s*:)(.+)")) {
if (!($_ -match "^(\s*\w+\s*)(\(*\s*[a-zA-Z0-9_-]+\s*\)*\s*):(.+)")) {
$_
}
}
Expand All @@ -69,7 +69,7 @@ function VersionDate-SubjectAuthor-NoMerges-Categorized {
foreach ($c in $commitCategory) {
$isTitleOutputted = $false
$commitHistoryTrimmed | % {
if ($_ -match "^(\s*$($c['Name'])\s*\(\s*[a-zA-Z0-9_-]+\s*\)\s*:)(.+)") {
if ($_ -match "^(\s*$($c['Name'])\s*)(\(*\s*[a-zA-Z0-9_-]+\s*\)*\s*):(.+)") {
if (!$isTitleOutputted) {
@"
Expand Down

0 comments on commit 477989c

Please sign in to comment.