Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CuratedPackage: Rename the pkg property to metadata
Browse files Browse the repository at this point in the history
This avoids the ugly `pkg.pkg` construct when accessing the `Package` of
a `CuratedPackage`.

Signed-off-by: Sebastian Schuberth <[email protected]>
sschuberth committed Sep 26, 2022

Verified

This commit was signed with the committer’s verified signature. The key has expired.
addaleax Anna Henningsen
1 parent c747f91 commit 077f525
Showing 43 changed files with 385 additions and 378 deletions.
2 changes: 1 addition & 1 deletion advisor/src/main/kotlin/Advisor.kt
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ class Advisor(

val results = sortedMapOf<Identifier, List<AdvisorResult>>()

val packages = ortResult.getPackages(skipExcluded).map { it.pkg }
val packages = ortResult.getPackages(skipExcluded).map { it.metadata }
if (packages.isEmpty()) {
logger.info { "There are no packages to give advice for." }
} else {
2 changes: 1 addition & 1 deletion advisor/src/test/kotlin/advisors/VulnerableCodeTest.kt
Original file line number Diff line number Diff line change
@@ -266,7 +266,7 @@ private fun resultFile(): File = File(TEST_FILES_ROOT).resolve(TEST_RESULT_NAME)
* Return a list with [Package]s from the analyzer result file that serve as input for the [VulnerableCode] advisor.
*/
private fun inputPackages(): List<Package> =
resultFile().readValue<OrtResult>().getPackages(false).map { it.pkg }
resultFile().readValue<OrtResult>().getPackages(false).map { it.metadata }

/**
* Generate the JSON body of the request to query information about packages. It mainly consists of an array with the
Loading

0 comments on commit 077f525

Please sign in to comment.