Skip to content

Commit 0cd72fa

Browse files
author
Oppodelldog
committed
added Project prefix to feature branch detection
1 parent 609d16b commit 0cd72fa

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

featurebranch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package gitcommithook
33
import "regexp"
44

55
var patterns = []string{
6-
`(?m)(?:\s|^|/)([A-Z]+-[0-9]+)([\s,;:!.-]|$)`,
6+
`(?m)(?:\s|^|/)(([A-Z](_)*)+-[0-9]+)([\s,;:!.-]|$)`,
77
}
88

99
//IsFeatureBranch detects weatcher the input matches one of the defined patterns

featurebranch_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ func TestIsFeatureBranch_Positive(t *testing.T) {
1414
}{
1515
{"TOOL-1242", true},
1616
{"feature/TOOL-1242", true},
17+
{"feature/PROJECT_XYZ-2938", true},
1718
}
1819

1920
for _, test := range testData {

0 commit comments

Comments
 (0)