Move issue/PR number to after action description (github)

This commit is contained in:
jesopo 2019-02-28 23:15:13 +00:00
parent 1dab3dd07e
commit 985fc51dea

View file

@ -515,8 +515,8 @@ class Module(ModuleManager.BaseModule):
pr_title = data["pull_request"]["title"] pr_title = data["pull_request"]["title"]
reviewer = utils.irc.bold(data["sender"]["login"]) reviewer = utils.irc.bold(data["sender"]["login"])
url = self._short_url(data["review"]["html_url"]) url = self._short_url(data["review"]["html_url"])
return ["[pr %s] %s %s a review on: %s - %s" % ( return ["[pr] %s %s a review on %s: %s - %s" %
number, reviewer, action, pr_title, url)] (reviewer, action, number, pr_title, url)]
def pull_request_review_comment(self, full_name, data): def pull_request_review_comment(self, full_name, data):
number = utils.irc.color("#%s" % data["pull_request"]["number"], number = utils.irc.color("#%s" % data["pull_request"]["number"],
@ -525,19 +525,17 @@ class Module(ModuleManager.BaseModule):
pr_title = data["pull_request"]["title"] pr_title = data["pull_request"]["title"]
sender = utils.irc.bold(data["sender"]["login"]) sender = utils.irc.bold(data["sender"]["login"])
url = self._short_url(data["comment"]["html_url"]) url = self._short_url(data["comment"]["html_url"])
return ["[pr %s] %s %s on a review: %s - %s" % return ["[pr] %s %s on a review on %s: %s - %s" %
(number, sender, COMMENT_ACTIONS[action], pr_title, url)] (sender, COMMENT_ACTIONS[action], number, pr_title, url)]
def issues(self, full_name, data): def issues(self, full_name, data):
number = utils.irc.color("#%s" % data["issue"]["number"], COLOR_ID) number = utils.irc.color("#%s" % data["issue"]["number"], COLOR_ID)
action = data["action"] action = data["action"]
action_desc = action
issue_title = data["issue"]["title"] issue_title = data["issue"]["title"]
author = utils.irc.bold(data["sender"]["login"]) author = utils.irc.bold(data["sender"]["login"])
url = self._short_url(data["issue"]["html_url"]) url = self._short_url(data["issue"]["html_url"])
return ["[issue %s] %s %s: %s - %s" % return ["[issue] %s %s %s: %s - %s" %
(number, author, action_desc, issue_title, url)] (author, action, number, issue_title, url)]
def issue_comment(self, full_name, data): def issue_comment(self, full_name, data):
if "changes" in data: if "changes" in data:
# don't show this event when nothing has actually changed # don't show this event when nothing has actually changed
@ -550,8 +548,8 @@ class Module(ModuleManager.BaseModule):
type = "pr" if "pull_request" in data["issue"] else "issue" type = "pr" if "pull_request" in data["issue"] else "issue"
commenter = utils.irc.bold(data["sender"]["login"]) commenter = utils.irc.bold(data["sender"]["login"])
url = self._short_url(data["comment"]["html_url"]) url = self._short_url(data["comment"]["html_url"])
return ["[%s %s] %s %s on: %s - %s" % return ["[%s] %s %s on %s: %s - %s" %
(type, number, commenter, COMMENT_ACTIONS[action], issue_title, (type, commenter, COMMENT_ACTIONS[action], number, issue_title,
url)] url)]
def create(self, full_name, data): def create(self, full_name, data):