Skip to content

Commit

Permalink
feat(model): Add the property Issue.affectedPath
Browse files Browse the repository at this point in the history
This property can be set in case the issue is limited to a file or
directory. This prepares for making use of it for ScanCode timeout
issues, e.g. filter out irrelevant timeout issues if outside the VCS
path or matched by a path exclude.

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Nov 30, 2023
1 parent 33be29a commit b3feae8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion model/src/main/kotlin/Issue.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.ossreviewtoolkit.model

import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.SerializerProvider
import com.fasterxml.jackson.databind.annotation.JsonSerialize
Expand Down Expand Up @@ -53,7 +54,13 @@ data class Issue(
/**
* The issue's severity.
*/
val severity: Severity = Severity.ERROR
val severity: Severity = Severity.ERROR,

/**
* The affected file or directory the issue is limited to, if any.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
val affectedPath: String? = null
) {
override fun toString(): String {
val time = if (timestamp == Instant.EPOCH) "Unknown time" else timestamp.toString()
Expand Down

0 comments on commit b3feae8

Please sign in to comment.