@@ -56,7 +56,7 @@ def logger_debug(*args):
56
56
return logger .debug (' ' .join (isinstance (a , str ) and a or repr (a ) for a in args ))
57
57
58
58
59
- def add_referenced_license_matches_for_package (resource , codebase , no_licenses ):
59
+ def add_referenced_license_matches_for_package (resource , codebase ):
60
60
"""
61
61
Return an updated ``resource`` saving it in place, after adding new license
62
62
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):
106
106
if not referenced_resource :
107
107
continue
108
108
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
116
110
117
111
if referenced_license_detections :
118
112
modified = True
@@ -160,7 +154,7 @@ def add_referenced_license_matches_for_package(resource, codebase, no_licenses):
160
154
yield resource
161
155
162
156
163
- def add_referenced_license_detection_from_package (resource , codebase , no_licenses ):
157
+ def add_referenced_license_detection_from_package (resource , codebase ):
164
158
"""
165
159
Return an updated ``resource`` saving it in place, after adding new license
166
160
matches (licenses and license_expressions) following their Rule
@@ -209,7 +203,6 @@ def add_referenced_license_detection_from_package(resource, codebase, no_license
209
203
sibling_license_detections , _le = get_license_detections_from_sibling_file (
210
204
resource = root_resource ,
211
205
codebase = codebase ,
212
- no_licenses = no_licenses ,
213
206
)
214
207
if TRACE :
215
208
logger_debug (
@@ -278,12 +271,10 @@ def add_referenced_license_detection_from_package(resource, codebase, no_license
278
271
yield resource
279
272
280
273
281
- def add_license_from_sibling_file (resource , codebase , no_licenses ):
274
+ def add_license_from_sibling_file (resource , codebase ):
282
275
"""
283
276
Given a resource and it's codebase object, assign licenses to the package
284
277
detections in that resource, from the sibling files of it.
285
-
286
- If `no_license` is True, then license scan (for resources) is disabled.
287
278
"""
288
279
if TRACE :
289
280
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):
303
294
license_detections , license_expression = get_license_detections_from_sibling_file (
304
295
resource = resource ,
305
296
codebase = codebase ,
306
- no_licenses = no_licenses ,
307
297
)
308
298
if not license_detections :
309
299
return
@@ -333,13 +323,11 @@ def is_legal_or_readme(resource):
333
323
return False
334
324
335
325
336
- def get_license_detections_from_sibling_file (resource , codebase , no_licenses ):
326
+ def get_license_detections_from_sibling_file (resource , codebase ):
337
327
"""
338
328
Return `license_detections`, a list of LicenseDetection objects and a
339
329
`license_expression`, given a resource and it's codebase object, from
340
330
the sibling files of the resource.
341
-
342
- If `no_license` is True, then license scan (for resources) is disabled.
343
331
"""
344
332
siblings = []
345
333
@@ -357,15 +345,7 @@ def get_license_detections_from_sibling_file(resource, codebase, no_licenses):
357
345
358
346
license_detections = []
359
347
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 )
369
349
370
350
if not license_detections :
371
351
return [], None
0 commit comments