Skip to content

Commit

Permalink
Added application plugin for validation
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Oct 16, 2024
1 parent 532c5ef commit 2df66b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions csaf-validation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
plugins {
id("buildlogic.kotlin-library-conventions")
application
}

application {
mainClass = "io.github.csaf.sbom.validation.MainKt"
}

mavenPublishing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ object Test611MissingDefinitionOfProductID : Test {
val definitions = doc.product_tree?.gatherProductIds() ?: setOf()
val references = gatherProductReferences(doc)

println(
"Gathered ${definitions.size} product ID definitions and ${references.size} product ID references"
)

val notDefined = references.subtract(definitions)

return if (notDefined.isEmpty()) {
Expand All @@ -44,6 +48,10 @@ object Test621UnusedDefinitionOfProductID : Test {
val definitions = doc.product_tree?.gatherProductIds() ?: setOf()
val references = gatherProductReferences(doc)

Check warning on line 49 in csaf-validation/src/main/kotlin/io/github/csaf/sbom/validation/tests/Tests.kt

View check run for this annotation

Codecov / codecov/patch

csaf-validation/src/main/kotlin/io/github/csaf/sbom/validation/tests/Tests.kt#L49

Added line #L49 was not covered by tests

println(
"Gathered ${definitions.size} product ID definitions and ${references.size} product ID references"

Check warning on line 52 in csaf-validation/src/main/kotlin/io/github/csaf/sbom/validation/tests/Tests.kt

View check run for this annotation

Codecov / codecov/patch

csaf-validation/src/main/kotlin/io/github/csaf/sbom/validation/tests/Tests.kt#L51-L52

Added lines #L51 - L52 were not covered by tests
)

val notUsed = definitions.subtract(references)

Check warning on line 55 in csaf-validation/src/main/kotlin/io/github/csaf/sbom/validation/tests/Tests.kt

View check run for this annotation

Codecov / codecov/patch

csaf-validation/src/main/kotlin/io/github/csaf/sbom/validation/tests/Tests.kt#L55

Added line #L55 was not covered by tests
return if (notUsed.isEmpty()) {
ValidationSuccessful

Check warning on line 57 in csaf-validation/src/main/kotlin/io/github/csaf/sbom/validation/tests/Tests.kt

View check run for this annotation

Codecov / codecov/patch

csaf-validation/src/main/kotlin/io/github/csaf/sbom/validation/tests/Tests.kt#L57

Added line #L57 was not covered by tests
Expand Down

0 comments on commit 2df66b3

Please sign in to comment.