File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ def add_project(
8181 component .group = purl .namespace
8282
8383 vcs_url = purl .qualifiers .get ("vcs_url" , "" )
84+ # ExternalReferenceType.VCS does not support ssh:// urls
8485 if vcs_url and "ssh://" not in vcs_url :
8586 component .external_references .add (
8687 ExternalReference (
Original file line number Diff line number Diff line change 1010from packageurl import PackageURL
1111from tldextract import TLDExtract
1212
13+ # Although tldextract can fetch the latest suffix list, we don't want that here
1314NO_FETCH_EXTRACT = TLDExtract (suffix_list_urls = (), extra_suffixes = ("local" ,))
1415
1516# Matches SSH-style Git URLs like:
@@ -94,7 +95,9 @@ def remote_url_to_purl(
9495
9596 if "svn" in parsed .scheme or "svn." in parsed .netloc :
9697 namespace , name = _namespace_and_name_from_domain_and_path (parsed .netloc , path )
97- namespace = namespace .replace ("/svn/" , "/" ).removeprefix ("p/" )
98+ if namespace .startswith ("p/" ):
99+ namespace = namespace [len ("p/" ) :]
100+ namespace = namespace .replace ("/svn/" , "/" )
98101
99102 else :
100103 match = SSH_REGEX .match (remote_url )
Original file line number Diff line number Diff line change @@ -113,10 +113,9 @@ def check_content(
113113 text = actual ,
114114 )
115115
116- assert actual .strip () == expected .strip (), "\n " .join (
117- f"Line { line_nr } : Actual >>{ actual .strip ()} << != Expected >>{ expected .strip ()} <<" ,
118- "ACTUAL:" ,
119- * actual_content ,
116+ assert actual .strip () == expected .strip (), (
117+ f"Line { line_nr } : Actual >>{ actual .strip ()} << != Expected >>{ expected .strip ()} <<\n "
118+ f"ACTUAL:\n { '' .join (actual_content )} "
120119 )
121120
122121
You can’t perform that action at this time.
0 commit comments