Skip to content

Commit efde376

Browse files
authored
Merge pull request #61 from Centril/patch-1
Strip "@" from "r=@username_foobar"
2 parents 406c7a5 + eae4ebe commit efde376

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
@@ -16,7 +16,7 @@ def __init__(self, action):
1616
def approve(cls, approver, commit):
1717
command = cls('approve')
1818
command.commit = commit
19-
command.actor = approver
19+
command.actor = approver.lstrip('@')
2020
return command
2121

2222
@classmethod

homu/tests/test_parse_issue_comment.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ def test_r_equals():
6868
assert command.actor == 'jill'
6969

7070

71+
def test_r_equals_at_user():
72+
"""
73+
@bors r=@jill
74+
"""
75+
76+
author = "jack"
77+
body = "@bors r=@jill"
78+
commands = parse_issue_comment(author, body, commit, "bors")
79+
80+
assert len(commands) == 1
81+
command = commands[0]
82+
assert command.action == 'approve'
83+
assert command.actor == 'jill'
84+
85+
7186
def test_hidden_r_equals():
7287
author = "bors"
7388
body = """

0 commit comments

Comments
 (0)