-
Notifications
You must be signed in to change notification settings - Fork 352
refactor: Move a private CLI helper function to the public analyzer API #7180
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
Conversation
* [AnalyzerConfiguration.disabledPackageManagers] configuration properties and the | ||
* [default][PackageManagerFactory.isEnabledByDefault] of the [PackageManager]s. | ||
*/ | ||
fun AnalyzerConfiguration.determineEnabledPackageManagers(): Set<PackageManagerFactory> { |
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.
@fviernau had the idea recently to not group functions by their type anymore, i.e. not put extensions functions into Extensions.kt
, but by functionality. I basically think that's a good idea. So instead of introducing a new Extensions.kt
, should we maybe move the function to e.g. analyzer/src/main/kotlin/Analyzer.kt
?
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'm not sure about that, maybe we should discuss in the next dev meeting if we want to define some rules here. To me Extensions.kt
fits well in this case, because it's an API extension to the AnalyzerConfiguration
class. Also, if moved it should probably go to PackageManager.kt
instead of Analyzer.kt
because that's the dependency of the function, but I'm also not a fan of putting too much functionality in a single file because it's against separation of concerns. Actually, I would also be for moving the parseAuthorString
function out of PackageManager.kt
for that reason.
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.
Ok, then let's stick to our current conventions for now and bring this up in the next Kotlin Developer Meeting.
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.
But there are unused imports 😉
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #7180 +/- ##
=========================================
Coverage 64.53% 64.53%
Complexity 1972 1972
=========================================
Files 334 334
Lines 16725 16725
Branches 2399 2399
=========================================
Hits 10793 10793
Misses 4885 4885
Partials 1047 1047
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Move the function to determine the enabled package managers to the public API of the analyzer to make it available when programmatically using ORT. Signed-off-by: Martin Nonnenmacher <[email protected]>
6decdca
to
c339742
Compare
Move the function to determine the enabled package managers to the public API of the analyzer to make it available when programmatically using ORT.