Skip to content

Commit

Permalink
Lowered priority from warning to info if detected repo_vendor is not …
Browse files Browse the repository at this point in the history
…supported yet
  • Loading branch information
tombreit committed Jan 12, 2024
1 parent 6d3fe22 commit 3491883
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

site_name: mkdocs-git-latest-changes-plugin
repo_url: https://github.com/tombreit/mkdocs-git-latest-changes-plugin
#repo_url: https://example.thismakesthepluginexplode.invalidtld
strict: true
plugins:
- git-latest-changes:
Expand Down
16 changes: 8 additions & 8 deletions src/mkdocs_git_latest_changes_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,22 +159,22 @@ def sanitize_string(string: str) -> str:


def get_repo_vendor(url: str) -> str:
hostname = ""
repo_vendor = ""

try:
components = urlsplit(url)
hostname = components.netloc.split(".")[-2]
hostname = hostname.lower()
repo_vendor = components.netloc.split(".")[-2]
repo_vendor = repo_vendor.lower()
except IndexError:
pass

if hostname and hostname not in SUPPORTED_REMOTE_REPOS.keys():
log.warning(
f"Repository config.repo_vendor '{hostname}' not supported. Only '{', '.join(SUPPORTED_REMOTE_REPOS.keys())}' supported. Commit hashes and filepaths will not be linkified."
if repo_vendor and repo_vendor not in SUPPORTED_REMOTE_REPOS.keys():
log.info(
f"Repository config.repo_vendor '{repo_vendor}' not supported. Only '{', '.join(SUPPORTED_REMOTE_REPOS.keys())}' supported. Commit hashes and filepaths will not be linkified."
)
hostname = ""
repo_vendor = ""

return hostname
return repo_vendor


def get_recent_changes(
Expand Down

0 comments on commit 3491883

Please sign in to comment.