1
Fork 0

Silence mypy

This commit is contained in:
Jake Howard 2020-01-08 22:42:33 +00:00
parent cb54bd1b0a
commit c966bb2574
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 7 additions and 1 deletions

View file

@ -60,7 +60,10 @@ def main():
for task in todoist_tasks.values(): for task in todoist_tasks.values():
if not is_task_completed(task) or task["id"] in tasks_actioned: if not is_task_completed(task) or task["id"] in tasks_actioned:
continue continue
org, repo, issue_number = get_github_issue_details(task["content"]) issue_details = get_github_issue_details(task["content"])
if not issue_details:
continue
org, repo, issue_number = issue_details
issue = get_issue(me, org, repo, issue_number) issue = get_issue(me, org, repo, issue_number)
me_assigned = me.login in {assignee.login for assignee in issue.assignees} me_assigned = me.login in {assignee.login for assignee in issue.assignees}
if not me_assigned: if not me_assigned:

View file

@ -19,6 +19,7 @@ def get_github_task(content) -> Optional[str]:
parsed_url.path parsed_url.path
): ):
return url return url
return None
def get_github_issue_details(content): def get_github_issue_details(content):
@ -27,6 +28,8 @@ def get_github_issue_details(content):
return return
parsed_url = urlparse(url) parsed_url = urlparse(url)
match = GITHUB_ISSUE_PR_RE.search(parsed_url.path) match = GITHUB_ISSUE_PR_RE.search(parsed_url.path)
if not match:
return
return match.group(1), match.group(2), match.group(4) return match.group(1), match.group(2), match.group(4)