From 56e02639bbe40e5fcbdae9ca173399177455250a Mon Sep 17 00:00:00 2001 From: Joel Timothy Oh Date: Mon, 20 May 2024 16:26:46 +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..11124b0 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..f1acf04 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..1fbd0cc 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..8931623 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..9e69a54 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..285d9e6 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) { @"