-
-
Notifications
You must be signed in to change notification settings - Fork 758
/
ConfigSpecBuilder.kt
32 lines (26 loc) · 983 Bytes
/
ConfigSpecBuilder.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package io.github.detekt.tooling.dsl
import io.github.detekt.tooling.api.spec.ConfigSpec
import java.net.URL
import java.nio.file.Path
@ProcessingModelDsl
class ConfigSpecBuilder : Builder<ConfigSpec> {
var shouldValidateBeforeAnalysis: Boolean? = null
var knownPatterns: Collection<String> = emptyList()
var useDefaultConfig: Boolean = false // false to be backwards compatible in 1.X
var resources: Collection<URL> = emptyList()
var configPaths: Collection<Path> = emptyList()
override fun build(): ConfigSpec = ConfigModel(
shouldValidateBeforeAnalysis,
knownPatterns,
useDefaultConfig,
resources,
configPaths
)
}
private data class ConfigModel(
override val shouldValidateBeforeAnalysis: Boolean?,
override val knownPatterns: Collection<String>,
override val useDefaultConfig: Boolean,
override val resources: Collection<URL>,
override val configPaths: Collection<Path>
) : ConfigSpec