Skip to content

Commit f15ed6a

Browse files
authored
Merge pull request #131 from JohnTitor/delegate-with-mention
Parse `delegate=` while stripping `@`
2 parents a23d61e + 748a938 commit f15ed6a

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

homu/parse_issue_comment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def delegate_author(cls):
4545
@classmethod
4646
def delegate(cls, delegate_to):
4747
command = cls('delegate')
48-
command.delegate_to = delegate_to
48+
command.delegate_to = delegate_to.lstrip('@')
4949
return command
5050

5151
@classmethod

homu/tests/test_parse_issue_comment.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,21 @@ def test_delegate_equals():
213213
assert command.delegate_to == 'jill'
214214

215215

216+
def test_delegate_equals_at_user():
217+
"""
218+
@bors delegate=@{username}
219+
"""
220+
221+
author = "jack"
222+
body = "@bors delegate=@jill"
223+
commands = parse_issue_comment(author, body, commit, "bors")
224+
225+
assert len(commands) == 1
226+
command = commands[0]
227+
assert command.action == 'delegate'
228+
assert command.delegate_to == 'jill'
229+
230+
216231
def test_delegate_minus():
217232
"""
218233
@bors delegate-

0 commit comments

Comments
 (0)