From d382ce3de4e7952fc90f8962641649058c4e73de Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Wed, 1 Nov 2017 12:55:57 -0700 Subject: [PATCH] Allow dash in reviewer name. Fixes #97. --- splitreviewer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/splitreviewer.py b/splitreviewer.py index 28c3553..4d22bcf 100644 --- a/splitreviewer.py +++ b/splitreviewer.py @@ -28,7 +28,7 @@ import re # any. If no reviewers were found, the description will just be the # one passed in. -reviewer_pattern = re.compile("^(.+)\s+\(?r=([a-zA-Z0-9.,]+[a-zA-Z0-9])\)?\.?\s*$") +reviewer_pattern = re.compile("^(.+)\s+\(?r=([a-zA-Z0-9.,\-]+[a-zA-Z0-9])\)?\.?\s*$") def split_reviewer(description): m = re.match(reviewer_pattern, description) @@ -58,6 +58,7 @@ def get_split_reviewer_tests(): tests.append(['Bug 1234 - whatever. (r=foo) ', ['Bug 1234 - whatever.', ['foo']]]) # parentheses, trailing space tests.append(['Bug 1234 - whatever, (r=foo) ', ['Bug 1234 - whatever', ['foo']]]) # parentheses, preceeded by comma. tests.append(['Bug 1234 - whatever. r=foo,bar,baz', ['Bug 1234 - whatever.', ['foo','bar','baz']]]) # multiple reviewers + tests.append(['Bug 1234 - whatever; r=build-peer', ['Bug 1234 - whatever', ['build-peer']]]) # dash in reviewer name return tests