Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homu/parse_issue_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def parse_issue_comment(username, body, sha, botname, hooks=[]):
re.findall(r'\S+', re.sub(botname_regex, '', x))
for x
in body.splitlines()
if '@' + botname in x)) # noqa
if '@' + botname in x and not x.lstrip().startswith('>'))) # noqa

commands = []

Expand Down
15 changes: 15 additions & 0 deletions homu/tests/test_parse_issue_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,3 +604,18 @@ def test_ignore_commands_after_bors_line():
command = commands[0]
assert command.action == 'approve'
assert command.actor == 'jack'


def test_in_quote():
"""
Test that a command in a quote (e.g. when replying by e-mail) doesn't
trigger.
"""

author = "jack"
body = """
> @bors r+
"""
commands = parse_issue_comment(author, body, commit, "bors")

assert len(commands) == 0