Skip to content

Commit

Permalink
style(trustsource): Apply some trivial reformatting
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Nov 3, 2023
1 parent ca7424a commit 6c25e2c
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,12 @@ class TrustSourceReporter : Reporter {

val nav = input.ortResult.dependencyNavigator
val scans = input.ortResult.getProjects().map { project ->
val deps = nav.scopeNames(project)
.flatMap { traverseDeps(input, nav.directDependencies(project, it)) }

NewScan(
module = project.id.name,
dependencies = deps
)
val deps = nav.scopeNames(project).flatMap { traverseDeps(input, nav.directDependencies(project, it)) }
NewScan(module = project.id.name, dependencies = deps)
}

outputFile.outputStream().use { JSON.encodeToStream(scans, it) }

return listOf(outputFile)
}
}
Expand All @@ -71,7 +67,6 @@ private fun traverseDeps(input: ReporterInput, deps: Sequence<DependencyNode>):
val licenses = effectiveLicense?.decompose()?.map {
val name = it.toString()
val url = it.getLicenseUrl().orEmpty()

License(name, url)
}

Expand All @@ -91,7 +86,6 @@ private fun traverseDeps(input: ReporterInput, deps: Sequence<DependencyNode>):
homepageUrl = pkg?.metadata?.homepageUrl.orEmpty(),
description = pkg?.metadata?.description.orEmpty(),
checksum = checksum.orEmpty(),

dependencies = dep.visitDependencies { traverseDeps(input, it) },
licenses = licenses.orEmpty(),
pkg = depPkg
Expand Down

0 comments on commit 6c25e2c

Please sign in to comment.