Skip to content

Commit 8431f94

Browse files
committed
Add threshold and report file output to detekt code analysis.
1 parent 4c9f14e commit 8431f94

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

buildSrc/src/main/kotlin/Dependencies.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ object BuildPlugins {
3030
const val kotlinAndroidExtensions = "kotlin-android-extensions"
3131
}
3232

33+
object ScriptPlugins {
34+
const val infrastructure = "scripts.infrastructure"
35+
const val variants = "scripts.variants"
36+
const val quality = "scripts.quality"
37+
const val compilation = "scripts.compilation"
38+
}
39+
3340
object Libraries {
3441
private object Versions {
3542
const val appCompat = "1.2.0"
@@ -105,12 +112,5 @@ object DevLibraries {
105112
const val leakCanary = "2.5"
106113
}
107114

108-
const val leakCanary = "com.squareup.leakcanary:leakcanary-android:${Versions.leakCanary}"
109-
}
110-
111-
object ScriptPlugins {
112-
const val infrastructure = "scripts.infrastructure"
113-
const val variants = "scripts.variants"
114-
const val quality = "scripts.quality"
115-
const val compilation = "scripts.compilation"
115+
const val leakCanary = "com.squareup.leakcanary:leakcanary-android:${Versions.leakCanary}"
116116
}

buildSrc/src/main/kotlin/scripts/quality.gradle.kts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ tasks.register("jacocoReport", JacocoReport::class) {
6464
executionData.setFrom(fileTree(project.buildDir) {
6565
include("**/*.exec", "**/*.ec") })
6666

67-
doLast {
68-
println("Code Coverage Report: $outputDir/index.html")
69-
}
67+
doLast { println("Code Coverage Report: $outputDir/index.html") }
7068
}
7169

7270
tasks.register("runTestCoverage") {
@@ -96,9 +94,9 @@ val detektAll by tasks.registering(Detekt::class) {
9694
txt.enabled = false
9795
}
9896

99-
doLast {
100-
println("Static Analysis Report: $outputFile")
101-
}
97+
val reportFile = "Static Analysis Report: $outputFile \n"
98+
doFirst { println(reportFile) }
99+
doLast { println(reportFile) }
102100
}
103101

104102
tasks.register("runStaticAnalysis") {

config/detekt/detekt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
build:
2-
maxIssues: 0
2+
maxIssues: 100
33
excludeCorrectable: false
44
weights:
55
# complexity: 2

0 commit comments

Comments
 (0)