@@ -56,7 +56,7 @@ def logger_debug(*args):
5656 return logger .debug (' ' .join (isinstance (a , str ) and a or repr (a ) for a in args ))
5757
5858
59- def add_referenced_license_matches_for_package (resource , codebase , no_licenses ):
59+ def add_referenced_license_matches_for_package (resource , codebase ):
6060 """
6161 Return an updated ``resource`` saving it in place, after adding new license
6262 detections to the package manifests detected in this resource, following their
@@ -106,13 +106,7 @@ def add_referenced_license_matches_for_package(resource, codebase, no_licenses):
106106 if not referenced_resource :
107107 continue
108108
109- if no_licenses :
110- referenced_license_detections = get_license_detection_mappings (
111- location = referenced_resource .location
112- )
113-
114- else :
115- referenced_license_detections = referenced_resource .license_detections
109+ referenced_license_detections = referenced_resource .license_detections
116110
117111 if referenced_license_detections :
118112 modified = True
@@ -160,7 +154,7 @@ def add_referenced_license_matches_for_package(resource, codebase, no_licenses):
160154 yield resource
161155
162156
163- def add_referenced_license_detection_from_package (resource , codebase , no_licenses ):
157+ def add_referenced_license_detection_from_package (resource , codebase ):
164158 """
165159 Return an updated ``resource`` saving it in place, after adding new license
166160 matches (licenses and license_expressions) following their Rule
@@ -209,7 +203,6 @@ def add_referenced_license_detection_from_package(resource, codebase, no_license
209203 sibling_license_detections , _le = get_license_detections_from_sibling_file (
210204 resource = root_resource ,
211205 codebase = codebase ,
212- no_licenses = no_licenses ,
213206 )
214207 if TRACE :
215208 logger_debug (
@@ -278,12 +271,10 @@ def add_referenced_license_detection_from_package(resource, codebase, no_license
278271 yield resource
279272
280273
281- def add_license_from_sibling_file (resource , codebase , no_licenses ):
274+ def add_license_from_sibling_file (resource , codebase ):
282275 """
283276 Given a resource and it's codebase object, assign licenses to the package
284277 detections in that resource, from the sibling files of it.
285-
286- If `no_license` is True, then license scan (for resources) is disabled.
287278 """
288279 if TRACE :
289280 logger_debug (f'packagedcode.licensing: add_license_from_sibling_file: resource: { resource .path } ' )
@@ -303,7 +294,6 @@ def add_license_from_sibling_file(resource, codebase, no_licenses):
303294 license_detections , license_expression = get_license_detections_from_sibling_file (
304295 resource = resource ,
305296 codebase = codebase ,
306- no_licenses = no_licenses ,
307297 )
308298 if not license_detections :
309299 return
@@ -333,13 +323,11 @@ def is_legal_or_readme(resource):
333323 return False
334324
335325
336- def get_license_detections_from_sibling_file (resource , codebase , no_licenses ):
326+ def get_license_detections_from_sibling_file (resource , codebase ):
337327 """
338328 Return `license_detections`, a list of LicenseDetection objects and a
339329 `license_expression`, given a resource and it's codebase object, from
340330 the sibling files of the resource.
341-
342- If `no_license` is True, then license scan (for resources) is disabled.
343331 """
344332 siblings = []
345333
@@ -357,15 +345,7 @@ def get_license_detections_from_sibling_file(resource, codebase, no_licenses):
357345
358346 license_detections = []
359347 for sibling in siblings :
360- if no_licenses :
361- detections = get_license_detection_mappings (
362- location = sibling .location ,
363- analysis = DetectionCategory .PACKAGE_ADD_FROM_SIBLING_FILE .value ,
364- post_scan = True ,
365- )
366- license_detections .extend (detections )
367- else :
368- license_detections .extend (sibling .license_detections )
348+ license_detections .extend (sibling .license_detections )
369349
370350 if not license_detections :
371351 return [], None
0 commit comments