Skip to content

Commit

Permalink
Run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gagb committed Dec 13, 2024
1 parent 778fca3 commit f1274dc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/markitdown/_markitdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit f1274dc

Please sign in to comment.