Commit 63894a5 Adjust the FIXES regex so they cover project having a dash in their name

2 files Authored and Committed by pingou 5 days ago
Adjust the FIXES regex so they cover project having a dash in their name

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>

    
 1 @@ -20,15 +20,15 @@
 2   FIXES = [
 3       re.compile(r'(?:.*\s+)?fixe?[sd]?:?\s*?#(\d+)', re.I),
 4       re.compile(
 5 -         r'(?:.*\s+)?fixe?[sd]?:?\s*?https?://.*/(\w+)'
 6 +         r'(?:.*\s+)?fixe?[sd]?:?\s*?https?://.*/([a-zA-z0-9_][a-zA-Z0-9-_]*)'
 7           '/(?:issue|pull-request)/(\d+)', re.I),
 8       re.compile(r'(?:.*\s+)?merge?[sd]?:?\s*?#(\d+)', re.I),
 9       re.compile(
10 -         r'(?:.*\s+)?merge?[sd]?:?\s*?https?://.*/(\w+)'
11 +         r'(?:.*\s+)?merge?[sd]?:?\s*?https?://.*/([a-zA-z0-9_][a-zA-Z0-9-_]*)'
12           '/(?:issue|pull-request)/(\d+)', re.I),
13       re.compile(r'(?:.*\s+)?close?[sd]?:?\s*?#(\d+)', re.I),
14       re.compile(
15 -         r'(?:.*\s+)?close?[sd]?:?\s*?https?://.*/(\w+)'
16 +         r'(?:.*\s+)?close?[sd]?:?\s*?https?://.*/([a-zA-z0-9_][a-zA-Z0-9-_]*)'
17           '/(?:issue|pull-request)/(\d+)', re.I),
18   ]
19   
1 @@ -260,6 +260,8 @@
2               ('test', '123'))
3           project_match('Merge: http://localhost/fork/pingou/test/issue/1234#foo',
4               ('test', '1234'))
5 +         project_match('Merges: https://localhost/SSSD/ding-libs/pull-request/3188',
6 +             ('ding-libs', '3188'))
7   
8           # issue matches
9           def issue_match(text, issue):