Created
January 20, 2022 07:33
-
-
Save bobbyirawan09/bf6968d54c560719ae8b6a5a285e0da2 to your computer and use it in GitHub Desktop.
Step 2 when adding Detekt to project, add the configuration
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
allprojects { | |
apply(plugin = "io.gitlab.arturbosch.detekt") // Version should be inherited from parent | |
repositories { | |
google() | |
mavenCentral() | |
} | |
/** | |
* Step 2 | |
* | |
* Source https://github.com/JLLeitschuh/ktlint-gradle/blob/master/plugin/src/main/kotlin/org/jlleitschuh/gradle/ktlint/KtlintExtension.kt | |
* Source from https://detekt.github.io/detekt/gradle.html#kotlin-dsl-3 | |
* */ | |
detekt { | |
source = files("src/main/java", "src/main/kotlin") | |
toolVersion = "1.18.1" | |
debug = true | |
config = files("${project.rootDir}/reports/detekt/config.yml") | |
baseline = file("${project.rootDir}/reports/detekt/baseline.xml") | |
ignoredBuildTypes = listOf("release") | |
basePath = "${project.rootDir}/reports/detekt" | |
reports { | |
html { | |
enabled = true | |
destination = file("${project.rootDir}/reports/detekt/detekt.html") | |
} | |
txt { | |
enabled = true | |
destination = file("${project.rootDir}/reports/detekt/detekt.txt") | |
} | |
} | |
} | |
plugins.withType(io.gitlab.arturbosch.detekt.DetektPlugin::class) { | |
tasks.withType(io.gitlab.arturbosch.detekt.Detekt::class) detekt@{ | |
finalizedBy(reportMerge) | |
reportMerge.configure { | |
input.from(this@detekt.xmlReportFile) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment