-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename RootLicenseMatcher
to ParentLicenseMatcher
#9302
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Sebastian Schuberth <[email protected]>
The name `RootLicenseMatcher` was confusing as not necessarily license files from the root are matched: If no license files are in the root, but a license file is in a parent directory on the path to the root directory, that license would be applicable. Reflect that in several renamings that avoid the "root" term if not appropriate. Signed-off-by: Sebastian Schuberth <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9302 +/- ##
============================================
- Coverage 67.77% 67.28% -0.50%
- Complexity 1187 1201 +14
============================================
Files 239 239
Lines 7821 8446 +625
Branches 904 905 +1
============================================
+ Hits 5301 5683 +382
- Misses 2153 2394 +241
- Partials 367 369 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@fviernau mind having a look as I have some follow-up changes? |
@@ -94,7 +94,7 @@ internal class GetPackageLicensesCommand : OrtHelperCommand( | |||
|
|||
val detectedLicense = curatedFindings.toSpdxExpression() | |||
|
|||
val rootLicense = RootLicenseMatcher().getApplicableRootLicenseFindingsForDirectories( | |||
val rootLicense = ParentLicenseMatcher().getApplicableLicenseFindingsForDirectories( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, parent only refers to the direct ancestor.
Just throwing in the idea to use MainLicenseMatcher
.
But not sure if this is good, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe "Main" has the same notion as "Root" in that it can be interpreted to only mean the license in the top-level directory. More ideas:
- AncestorLicenseMatcher
- InheritedLicenseMatcher
- ApplicableLicenseMatcher
- PathLicenseMatcher
Out of these, probably PathLicenseMatcher
is the simplest and least repetitive WRT the class method names.
Any preferences from our side, @fviernau?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puh, I'm having a hard time deciding this (except that I would not use Applicable because also licenses in other files can be applicable). Let's maybe do a quick poll on the preferred terminology. @mnonnenmacher @tsteenbe any preferences / ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least @mnonnenmacher is on vacation, and I'd like to proceed with this before he's back in two weeks.
Sorry, missed that my comment was in "pending" state. |
Please have a look at the individual commit messages for the details.