Skip to content

Commit

Permalink
url2purl: linter -> reformat cran functions
Browse files Browse the repository at this point in the history
  • Loading branch information
schischi committed Mar 11, 2024
1 parent aedc29c commit c34054c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/packageurl/contrib/purl2url.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def build_rubygems_repo_url(purl):
elif name:
return f"https://rubygems.org/gems/{name}"


@repo_router.route("pkg:cran/.*")
def build_cran_repo_url(purl):
"""
Expand Down
4 changes: 1 addition & 3 deletions src/packageurl/contrib/url2purl.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,7 @@ def build_rubygems_purl(uri):
"https?://packagemanager.rstudio.com/cran/.*",
)
def build_cran_purl(uri):
cran_pattern = (
r"^https?://(cran\.r-project\.org|packagemanager\.rstudio\.com/cran)/.*?src/contrib/(?P<name>.+)_(?P<version>.+)\.tar.gz$"
)
cran_pattern = r"^https?://(cran\.r-project\.org|packagemanager\.rstudio\.com/cran)/.*?src/contrib/(?P<name>.+)_(?P<version>.+)\.tar.gz$"
qualifiers = {}
if "//cran.r-project.org/" not in uri:
qualifiers["download_url"] = uri
Expand Down

0 comments on commit c34054c

Please sign in to comment.