From c966bb2574f3f3aebf2ddb75261c18cbe6c31279 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 8 Jan 2020 22:42:33 +0000 Subject: [PATCH] Silence mypy --- todoist_github/cli.py | 5 ++++- todoist_github/utils.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/todoist_github/cli.py b/todoist_github/cli.py index b3bba8f..97b75d2 100755 --- a/todoist_github/cli.py +++ b/todoist_github/cli.py @@ -60,7 +60,10 @@ def main(): for task in todoist_tasks.values(): if not is_task_completed(task) or task["id"] in tasks_actioned: 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) me_assigned = me.login in {assignee.login for assignee in issue.assignees} if not me_assigned: diff --git a/todoist_github/utils.py b/todoist_github/utils.py index 27aa207..ff5c412 100644 --- a/todoist_github/utils.py +++ b/todoist_github/utils.py @@ -19,6 +19,7 @@ def get_github_task(content) -> Optional[str]: parsed_url.path ): return url + return None def get_github_issue_details(content): @@ -27,6 +28,8 @@ def get_github_issue_details(content): return parsed_url = urlparse(url) match = GITHUB_ISSUE_PR_RE.search(parsed_url.path) + if not match: + return return match.group(1), match.group(2), match.group(4)