-
Notifications
You must be signed in to change notification settings - Fork 321
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
Inline advisor record #8865
Inline advisor record #8865
Conversation
@@ -333,4 +333,4 @@ | |||
return AdvisorResult(details, summary, defects, vulnerabilities) | |||
} | |||
|
|||
private fun advisorRecordOf(vararg results: Pair<Identifier, List<AdvisorResult>>) = AdvisorRecord(results.toMap()) | |||
private fun advisorRunOf(vararg results: Pair<Identifier, List<AdvisorResult>>) = AdvisorRun.EMPTY.copy(results = results.toMap()) |
Check warning
Code scanning / detekt
Format signature to be single when possible, multiple lines otherwise. Warning test
@@ -333,4 +333,4 @@ | |||
return AdvisorResult(details, summary, defects, vulnerabilities) | |||
} | |||
|
|||
private fun advisorRecordOf(vararg results: Pair<Identifier, List<AdvisorResult>>) = AdvisorRecord(results.toMap()) | |||
private fun advisorRunOf(vararg results: Pair<Identifier, List<AdvisorResult>>) = AdvisorRun.EMPTY.copy(results = results.toMap()) |
Check warning
Code scanning / detekt
Line detected, which is longer than the defined maximum line length in the code style. Warning test
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8865 +/- ##
=========================================
Coverage 67.55% 67.55%
Complexity 1166 1166
=========================================
Files 244 244
Lines 7769 7769
Branches 864 864
=========================================
Hits 5248 5248
Misses 2165 2165
Partials 356 356
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
7241575
to
ca1aef4
Compare
The constant will be used in later commits. Signed-off-by: Martin Nonnenmacher <[email protected]>
The `AdvisorRecord` was only a holder for the map of advisor results per package. Inline it with `AdvisorRun` to reduce nesting in the data structures, similar to how `ScanRecord` was inlined with `ScannerRun` in 9d9a449. Signed-off-by: Martin Nonnenmacher <[email protected]>
ca1aef4
to
351cf82
Compare
environment = Environment(), | ||
config = AdvisorConfiguration(), |
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.
Unrelated, but I wonder whether we should rename these kind of constants to e.g. DEFAULT
instead, as the values are not really empty.
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.
That's right, but the most relevant part is empty, like the results in this case. I guess there are good arguments for both names.
Align with the removal of `AdvisorRecord` [1]. [1]: oss-review-toolkit/ort#8865
Align with the removal of `AdvisorRecord` [1]. [1]: oss-review-toolkit/ort#8865
The
AdvisorRecord
was only a holder for the map of advisor results per package. Inline it withAdvisorRun
to reduce nesting in the data structures, similar to howScanRecord
was inlined withScannerRun
in 9d9a449.