Skip to content

Commit

Permalink
feat(model): Add OrtResult.isExcluded(Issue,Identifier)
Browse files Browse the repository at this point in the history
This can be useful for filtering issues, for example in reporters.

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Apr 23, 2024
1 parent ba6dc0f commit 77e3163
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions model/src/main/kotlin/OrtResult.kt
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,12 @@ data class OrtResult(
isPackageExcluded(id)
}

/**
* Return `true` if and only if the given [issue] is excluded in scope of the given [id].
*/
fun isExcluded(issue: Issue, id: Identifier): Boolean =
isExcluded(id) || issue in excludedAffectedPathIssuesForId[id].orEmpty()

/**
* Return `true` if all dependencies on the package or project identified by the given [id] are excluded. This is
* the case if all [Project]s or [Scope]s that have a dependency on this [id] are excluded.
Expand Down

0 comments on commit 77e3163

Please sign in to comment.