Skip to content

Commit

Permalink
feat(scanner): Expose the snippet choices to the scanner
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Nobelis <[email protected]>
  • Loading branch information
nnobelis committed Feb 16, 2024
1 parent 376bf37 commit 3d163d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 7 additions & 1 deletion scanner/src/main/kotlin/ScanContext.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import org.ossreviewtoolkit.model.Package
import org.ossreviewtoolkit.model.PackageType
import org.ossreviewtoolkit.model.config.Excludes
import org.ossreviewtoolkit.model.config.ScannerConfiguration
import org.ossreviewtoolkit.model.config.SnippetChoices
import org.ossreviewtoolkit.utils.spdx.SpdxExpression

/**
Expand Down Expand Up @@ -60,5 +61,10 @@ data class ScanContext(
* The packages known to be covered in the context of this scan. For package scanners, this is the list of packages
* that have the same provenance as the reference package.
*/
val coveredPackages: List<Package> = emptyList()
val coveredPackages: List<Package> = emptyList(),

/**
* The [SnippetChoices] of the project to scan.
*/
val snippetChoices: List<SnippetChoices> = emptyList()
)
6 changes: 4 additions & 2 deletions scanner/src/main/kotlin/Scanner.kt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ class Scanner(
ortResult.labels + labels,
PackageType.PROJECT,
ortResult.repository.config.excludes,
scannerConfig.detectedLicenseMapping
scannerConfig.detectedLicenseMapping,
snippetChoices = ortResult.repository.config.snippetChoices
)
)

Expand All @@ -127,7 +128,8 @@ class Scanner(
ortResult.labels,
PackageType.PACKAGE,
ortResult.repository.config.excludes,
scannerConfig.detectedLicenseMapping
scannerConfig.detectedLicenseMapping,
snippetChoices = ortResult.repository.config.snippetChoices
)
)

Expand Down

0 comments on commit 3d163d9

Please sign in to comment.