Improve maven license detection#4261
Merged
AyanSinhaMahapatra merged 3 commits intodevelopfrom Apr 22, 2025
Merged
Conversation
We were only storing the list of attributes but the now "license" top
level elements. Because of this a maven tag with only name: mit would
not be detected properly as there is no rule for this and this would
yield too many false positive. Now we have a structure that is a list
of license as {license: {name: mit, url: foo: comments: bar}}
This ensures a more accurate detection. With this also regenerate all
Maven related tests, and also ensure we filter early empty and unused
license attributes (such as the "distribution")
Also add new tests and apply mild refactoring for maven license
detection for clarity.
Remove redundant tests and simplify some other tests for clarity.
Signed-off-by: Philippe Ombredanne <[email protected]>
Member
Author
|
This can only be merged after: |
6 tasks
AyanSinhaMahapatra
approved these changes
Apr 22, 2025
Member
AyanSinhaMahapatra
left a comment
There was a problem hiding this comment.
LGTM! Thanks++ @pombredanne
This can be merged after we merge #4215
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.
This PR builds on top of:
... to address some issues with Maven license detection including bug fixes.
This fixes MIT license not detected in Maven POM #4262
We were only storing the list of attributes but the now "license" top level elements. Because of this a maven tag with only name: mit would not be detected properly as there is no rule for this and this would yield too many false positive. Now we have a structure that is a list of license as {license: {name: mit, url: foo: comments: bar}}
This PR ensures a more accurate detection. With this also regenerate all Maven related tests, and also ensure we filter early empty and unused license attributes (such as the "distribution")
Also add new tests and apply mild refactoring for maven license
detection for clarity.
Remove redundant tests and simplify some other tests for clarity.
Tasks
Run tests locally to check for errors.