From 477989c8696000808aff97aff09cdf627e714264 Mon Sep 17 00:00:00 2001 From: Joel Timothy Oh Date: Mon, 20 May 2024 16:03:50 +0000 Subject: [PATCH] Enhancement (generate): Fix regex patterns for matching commit messages following categorized conventions --- .../variants/Changes-HashSubject-NoMerges-Categorized.ps1 | 4 ++-- .../Changes-HashSubjectAuthor-NoMerges-Categorized.ps1 | 4 ++-- .../variants/VersionDate-HashSubject-NoMerges-Categorized.ps1 | 4 ++-- .../VersionDate-HashSubjectAuthor-NoMerges-Categorized.ps1 | 4 ++-- .../variants/VersionDate-Subject-NoMerges-Categorized.ps1 | 4 ++-- .../VersionDate-SubjectAuthor-NoMerges-Categorized.ps1 | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges-Categorized.ps1 index ca0f40c..81245ae 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges-Categorized.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubject-NoMerges-Categorized.ps1 @@ -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*):(.+)")) { $_ } } @@ -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) { @" diff --git a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubjectAuthor-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubjectAuthor-NoMerges-Categorized.ps1 index 877aa33..de82f3e 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubjectAuthor-NoMerges-Categorized.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/Changes-HashSubjectAuthor-NoMerges-Categorized.ps1 @@ -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*):(.+)")) { $_ } } @@ -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) { @" diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges-Categorized.ps1 index 44dfeb1..8e1445a 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges-Categorized.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubject-NoMerges-Categorized.ps1 @@ -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*):(.+)")) { $_ } } @@ -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) { @" diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubjectAuthor-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubjectAuthor-NoMerges-Categorized.ps1 index 1ec7722..d771a14 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubjectAuthor-NoMerges-Categorized.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-HashSubjectAuthor-NoMerges-Categorized.ps1 @@ -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*):(.+)")) { $_ } } @@ -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) { @" diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges-Categorized.ps1 index 2633541..192907f 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges-Categorized.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-Subject-NoMerges-Categorized.ps1 @@ -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*):(.+)")) { $_ } } @@ -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) { @" diff --git a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-SubjectAuthor-NoMerges-Categorized.ps1 b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-SubjectAuthor-NoMerges-Categorized.ps1 index 364df2f..1d29423 100644 --- a/src/PSRepositoryReleaseManager/generate/variants/VersionDate-SubjectAuthor-NoMerges-Categorized.ps1 +++ b/src/PSRepositoryReleaseManager/generate/variants/VersionDate-SubjectAuthor-NoMerges-Categorized.ps1 @@ -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*):(.+)")) { $_ } } @@ -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) { @"