Skip to content

Commit

Permalink
Fix missing spdx license expression in license detection
Browse files Browse the repository at this point in the history
Occassionally, the spdx license expression is missing in license detections
even though the license expression itself is non-null and a matching
spdx expression would be available. At least some instances of this
bug are due to post processing of detections, in which only the
license expression but not the spdx license expression is corrected for
license clues that are converted to license detections in post processing.

Signed-off-by: alexzurbonsen <[email protected]>
  • Loading branch information
alexzurbonsen committed Dec 16, 2024
1 parent c40476a commit 8c7d741
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/licensedcode/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1907,6 +1907,7 @@ def process_detections(detections, licensing=Licensing()):
for key in license_keys
):
detection.license_expression = license_expression
detection.license_expression_spdx = detection.spdx_license_expression()
detection.detection_log.append(DetectionRule.NOT_LICENSE_CLUES.value)
detection.identifier = detection.identifier_with_expression

Expand Down

0 comments on commit 8c7d741

Please sign in to comment.