Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce baseline tooling api (#5239)
- Loading branch information
1 parent
4288574
commit d21596a
Showing
11 changed files
with
124 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/baseline/BaselineFilteredResult.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
...turbosch/detekt/core/baseline/Baseline.kt → ...h/detekt/core/baseline/DefaultBaseline.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...t-core/src/main/resources/META-INF/services/io.github.detekt.tooling.api.BaselineProvider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
io.gitlab.arturbosch.detekt.core.baseline.BaselineFormat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
detekt-tooling/src/main/kotlin/io/github/detekt/tooling/api/BaselineProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.github.detekt.tooling.api | ||
|
||
import io.gitlab.arturbosch.detekt.api.Finding | ||
import java.nio.file.Path | ||
import java.util.ServiceLoader | ||
|
||
interface BaselineProvider { | ||
|
||
fun id(finding: Finding): FindingId | ||
fun of(manuallySuppressedIssues: FindingsIdList, currentIssues: FindingsIdList): Baseline | ||
fun read(sourcePath: Path): Baseline | ||
fun write(targetPath: Path, baseline: Baseline) | ||
|
||
companion object { | ||
|
||
fun load( | ||
classLoader: ClassLoader = BaselineProvider::class.java.classLoader, | ||
): BaselineProvider = ServiceLoader.load(BaselineProvider::class.java, classLoader).first() | ||
} | ||
} | ||
|
||
typealias FindingsIdList = Set<String> | ||
typealias FindingId = String | ||
|
||
interface Baseline { | ||
|
||
val manuallySuppressedIssues: FindingsIdList | ||
val currentIssues: FindingsIdList | ||
|
||
fun contains(id: FindingId): Boolean | ||
} |