Skip to content

Commit

Permalink
feat: git.log.Scope ( Fixes #303 )
Browse files Browse the repository at this point in the history
  • Loading branch information
StartAutomating authored and StartAutomating committed Sep 27, 2024
1 parent 6c81e91 commit bc675f9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ugit.types.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,29 @@ if ($pushed) {
[Regex]::new("#(?<n>\d+)").Matches($this.CommitMessage) -replace '#' -as [int[]]
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>Scope</Name>
<GetScriptBlock>
&lt;#
.SYNOPSIS
Gets the scope of a conventional commit
.DESCRIPTION
Gets the scope of a conventional commit, based on the commit message.
.LINK
https://www.conventionalcommits.org/en/v1.0.0/#summary
#&gt;
if ($this.CommitMessage -match '^(?&lt;Type&gt;[^\r\n]+?):\s{0,}(?&lt;Message&gt;[^\r\n]+)') {
$matchType = $Matches.Type
if ($matchType -match '\(') {
$matchType -replace '.+?\(' -replace '\)\s{0,}$'
} else {
return ''
}
} else {
return ''
}
</GetScriptBlock>
</ScriptProperty>
</Members>
</Type>
<Type>
Expand Down

0 comments on commit bc675f9

Please sign in to comment.