Fix missing spdx license expression in license detection#4023
Merged
AyanSinhaMahapatra merged 1 commit intoaboutcode-org:developfrom Jan 14, 2025
Merged
Conversation
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]>
Contributor
Author
|
@AyanSinhaMahapatra Seems like this could fix #4015 ? It seems to work for the test file that I was looking at. |
AyanSinhaMahapatra
approved these changes
Jan 14, 2025
Member
AyanSinhaMahapatra
left a comment
There was a problem hiding this comment.
LGTM!
Thanks @alexzurbonsen for the fix.
This fixes the issue we were having in some cases of imperfect license detections.
I have also added a rule at dcabc07 to fix the detection issue. Thanks for reporting this and apologies for the very late reply.
Contributor
Author
|
@AyanSinhaMahapatra No worries, thanks for merging :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
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.
Should fix #4015
Summary
In the post processing step clues are converted to detections under certain conditions. This entails that their license expression may be updated if it was previously
None. In these cases, we also need to update the spdx license expression.It seems that this fix covers at least some instances of the bug, that I know of.
Test Plan
Run scancode on the example from #4015
The result:
scancode_null_expression.json
Tasks
Run tests locally to check for errors.