diff --git a/featurebranch.go b/featurebranch.go index 94e07b8..2bd339d 100644 --- a/featurebranch.go +++ b/featurebranch.go @@ -3,7 +3,7 @@ package gitcommithook import "regexp" var patterns = []string{ - `(?m)(?:\s|^|/)([A-Z]+-[0-9]+)([\s,;:!.-]|$)`, + `(?m)(?:\s|^|/)(([A-Z](_)*)+-[0-9]+)([\s,;:!.-]|$)`, } //IsFeatureBranch detects weatcher the input matches one of the defined patterns diff --git a/featurebranch_test.go b/featurebranch_test.go index be7647e..572ed23 100644 --- a/featurebranch_test.go +++ b/featurebranch_test.go @@ -14,6 +14,7 @@ func TestIsFeatureBranch_Positive(t *testing.T) { }{ {"TOOL-1242", true}, {"feature/TOOL-1242", true}, + {"feature/PROJECT_XYZ-2938", true}, } for _, test := range testData {