From f1274dca87ef536f62c392dd44be59af0ef5e2d4 Mon Sep 17 00:00:00 2001 From: gagb Date: Fri, 13 Dec 2024 13:58:24 -0800 Subject: [PATCH] Run pre-commit --- src/markitdown/_markitdown.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/markitdown/_markitdown.py b/src/markitdown/_markitdown.py index 225fe99..d7672fa 100644 --- a/src/markitdown/_markitdown.py +++ b/src/markitdown/_markitdown.py @@ -849,7 +849,6 @@ class GitHubIssueConverter(DocumentConverter): """Converts GitHub issues to Markdown.""" def convert(self, issue_url, github_token) -> Union[None, DocumentConverterResult]: - # Bail if not a valid GitHub issue URL if issue_url: parsed_url = urlparse(issue_url) @@ -858,7 +857,9 @@ def convert(self, issue_url, github_token) -> Union[None, DocumentConverterResul return None if not github_token: - raise ValueError("GitHub token is not set. Cannot convert GitHub issue.") + raise ValueError( + "GitHub token is not set. Cannot convert GitHub issue." + ) return self._convert_github_issue(issue_url, github_token) @@ -972,8 +973,12 @@ def convert( if parsed_url.hostname == "github.com" and "/issues/" in parsed_url.path: github_token = kwargs.get("github_token", os.getenv("GITHUB_TOKEN")) if not github_token: - raise ValueError("GitHub token is required for GitHub issue conversion.") - return GitHubIssueConverter().convert(issue_url=source, github_token=github_token) + raise ValueError( + "GitHub token is required for GitHub issue conversion." + ) + return GitHubIssueConverter().convert( + issue_url=source, github_token=github_token + ) # Local path or url if isinstance(source, str):