Skip to content

Commit

Permalink
fix: project url transform for unlisted sites
Browse files Browse the repository at this point in the history
  • Loading branch information
hrz6976 committed Jun 27, 2024
1 parent 1603a3f commit a2c23ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ def test_project_url(woc):
assert project.url == "https://git.code.sf.net/p/peazip"
project = Project("gitlab.com_openRGB_openRGB")
assert project.url == "https://gitlab.com/openRGB/openRGB"
project = Project("chromium.googlesource.com_chromiumos_platform/factory")
assert project.url == "https://chromium.googlesource.com/chromiumos/platform/factory"
project = Project("greicekcgm_greice_kelli_cristan_goncalves_mota_jamstackalura")
assert (
project.url
== "https://github.com/greicekcgm/greice_kelli_cristan_goncalves_mota_jamstackalura"
)


def test_project_head(woc):
Expand Down
3 changes: 3 additions & 0 deletions woc/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,9 @@ def _platform_repo(self) -> str:
elif prefix in URL_PREFIXES and "_" in body:
platform = URL_PREFIXES[prefix]
body = body.replace("_", "/", 1)
elif "." in prefix:
platform = prefix
body = body.replace("_", "/", 1)
else:
platform = "github.com"
body = self.key.replace("_", "/", 1)
Expand Down
2 changes: 2 additions & 0 deletions woc/wocprofile.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"cs3": "[compressed]str_str_str"
},
"sites": {
"bb": "bitbucket.org",
"bitbucket.org": "bitbucket.org",
"gl": "gitlab.com",
"gitlab.com": "gitlab.com",
"android.googlesource.com": "android.googlesource.com",
"bioconductor.org": "bioconductor.org",
Expand Down

0 comments on commit a2c23ec

Please sign in to comment.