Skip to content

Commit

Permalink
CommitBear: Change regex for issue id
Browse files Browse the repository at this point in the history
This changes regex for issue id to allow
only numeric reference for issue number.

Closes coala#2469
  • Loading branch information
kriti21 committed May 24, 2018
1 parent 51441bd commit 9332d3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions bears/vcs/CommitBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ class _CommitBear(GlobalBear):
CAN_DETECT = {'Formatting'}
ISSUE_INFO = {
'github': {
'issue': r'(?:\w+/\w+)?#(\S+)',
'full issue': r'https?://github\S+/issues/(\S+)',
'issue': r'(?:\w+/\w+)?#(\d+)',
'full issue': r'https?://github\S+/issues/(\d+)',
},
'gitlab': {
'issue': r'(?:\w+/\w+)?#(\S+)',
'full issue': r'https?://gitlab\S+/issues/(\S+)',
'issue': r'(?:\w+/\w+)?#(\d+)',
'full issue': r'https?://gitlab\S+/issues/(\d+)',
},
'bitbucket': {
'issue': r'#(\d+)',
Expand Down
4 changes: 2 additions & 2 deletions tests/vcs/git/GitCommitBearTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def test_check_issue_reference(self):
self.assertEqual(self.run_uut(
body_close_issue=True,
body_close_issue_full_url=True),
['Invalid issue number: '
['Invalid full issue reference: '
'https://gitlab.com/user/repo/issues/not_num'])
self.assert_no_msgs()

Expand All @@ -526,7 +526,7 @@ def test_check_issue_reference(self):
'Another line, blablablablablabla.\n'
'Resolve #11 and close #notnum')
self.assertEqual(self.run_uut(body_close_issue=True,),
['Invalid issue number: #notnum'])
['Invalid issue reference: #notnum'])
self.assert_no_msgs()

# Close issues in other repos
Expand Down

0 comments on commit 9332d3d

Please sign in to comment.