Skip to content

Commit 92da2f2

Browse files
committed
Fix CI black format
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
1 parent d02949b commit 92da2f2

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

src/packageurl/contrib/purl2url.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,7 @@ def build_gitlab_repo_url(purl):
196196
"repo_url": "https://{namespace}/{name}",
197197
},
198198
# allura
199-
(
200-
r"sourceforge\.net",
201-
r"forge-allura\.apache\.org"
202-
): {
199+
(r"sourceforge\.net", r"forge-allura\.apache\.org"): {
203200
"commit_url": "https://{namespace}/{name}/ci/{version}",
204201
"repo_url": "https://{namespace}/{name}",
205202
},
@@ -232,6 +229,7 @@ def build_gitlab_repo_url(purl):
232229
},
233230
}
234231

232+
235233
@repo_router.route("pkg:generic/.*")
236234
def build_generic_repo_url(purl):
237235
"""

src/packageurl/contrib/url2purl.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ def build_gitea_purl(url):
735735
if commit_match:
736736
return PackageURL(
737737
type="generic",
738-
namespace=commit_match.group('namespace'),
738+
namespace=commit_match.group("namespace"),
739739
name=commit_match.group("name"),
740740
version=commit_match.group("version"),
741741
)
@@ -771,10 +771,7 @@ def build_cgit_purl(url):
771771
"""
772772

773773
# https://git.kernel.org/stable/c/<hash>
774-
kernel_shorthand = (
775-
r"^https?://git\.kernel\.org/stable/c/"
776-
r"(?P<version>[0-9a-fA-F]{7,64})/?$"
777-
)
774+
kernel_shorthand = r"^https?://git\.kernel\.org/stable/c/" r"(?P<version>[0-9a-fA-F]{7,64})/?$"
778775

779776
cgit_project_pattern = (
780777
r"^https?://"
@@ -792,7 +789,7 @@ def build_cgit_purl(url):
792789
elif match := re.search(cgit_project_pattern, url):
793790
res = match.groupdict()
794791
name = res["name"]
795-
namespace = res['namespace']
792+
namespace = res["namespace"]
796793
else:
797794
return None
798795

@@ -875,7 +872,7 @@ def build_allura_purl(url):
875872
if commit_match:
876873
return PackageURL(
877874
type="generic",
878-
namespace=commit_match.group('namespace'),
875+
namespace=commit_match.group("namespace"),
879876
name=commit_match.group("name"),
880877
version=commit_match.group("version"),
881878
qualifiers={},

0 commit comments

Comments
 (0)