Updated detekt version and config
This commit is contained in:
parent
67c2f87567
commit
4301c79e8c
|
|
@ -7,7 +7,7 @@ plugins {
|
|||
|
||||
// The kotlin-dsl plugin requires a repository to be declared
|
||||
repositories {
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ dependencies {
|
|||
// android gradle plugin, required by custom plugin
|
||||
implementation("com.android.tools.build:gradle:4.0.1")
|
||||
|
||||
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.10.0")
|
||||
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.19.0")
|
||||
implementation("de.aaschmid:gradle-cpd-plugin:3.1")
|
||||
|
||||
// kotlin plugin, required by custom plugin
|
||||
|
|
|
|||
|
|
@ -43,11 +43,11 @@ class DetektLinter : Linter {
|
|||
|
||||
config.setFrom(project.files("${extension.buildScriptDir!!}/static_analysis_configs/detekt-config.yml"))
|
||||
reports {
|
||||
txt.enabled = false
|
||||
html.enabled = false
|
||||
txt.required.set(false)
|
||||
html.required.set(false)
|
||||
xml {
|
||||
enabled = true
|
||||
destination = project.getDetektReportFile()
|
||||
required.set(true)
|
||||
outputLocation.set(project.getDetektReportFile())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import com.android.build.gradle.AppExtension
|
|||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
import static_analysis.linters.AndroidLinter
|
||||
import static_analysis.linters.CpdLinter
|
||||
import static_analysis.linters.DetektLinter
|
||||
import static_analysis.linters.Linter
|
||||
import java.util.Locale
|
||||
|
||||
class StaticAnalysisAndroidPlugin : StaticAnalysisPlugin() {
|
||||
|
||||
|
|
@ -17,19 +17,18 @@ class StaticAnalysisAndroidPlugin : StaticAnalysisPlugin() {
|
|||
extensions.getByType<AppExtension>().apply {
|
||||
applicationVariants.forEach { variant ->
|
||||
project.tasks.register("staticAnalysis${variant.name.capitalize()}") {
|
||||
setupStaticAnalysisTask(linters, variant.name)
|
||||
setupStaticAnalysisTask(linters, variant.name)
|
||||
}
|
||||
}
|
||||
|
||||
project.tasks.register("staticAnalysis") {
|
||||
setupStaticAnalysisTask(
|
||||
linters = linters,
|
||||
buildVariant = applicationVariants.first { it.name.contains("Debug") }.name
|
||||
buildVariant = applicationVariants.first { it.name.toLowerCase(Locale.ROOT).contains("debug") }.name
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@ complexity:
|
|||
threshold: 40
|
||||
LongParameterList:
|
||||
active: true
|
||||
threshold: 10
|
||||
functionThreshold: 10
|
||||
constructorThreshold: 10
|
||||
ignoreDefaultParameters: false
|
||||
MethodOverloading:
|
||||
active: false
|
||||
|
|
@ -268,7 +269,7 @@ potential-bugs:
|
|||
active: false
|
||||
LateinitUsage:
|
||||
active: false
|
||||
excludeAnnotatedProperties: ""
|
||||
ignoreAnnotated: []
|
||||
ignoreOnClassesPattern: ""
|
||||
UnconditionalJumpStatementInLoop:
|
||||
active: false
|
||||
|
|
@ -369,7 +370,7 @@ style:
|
|||
active: true
|
||||
UnnecessaryAbstractClass:
|
||||
active: false
|
||||
excludeAnnotatedClasses: "dagger.Module"
|
||||
ignoreAnnotated: ["dagger.Module"]
|
||||
UnnecessaryApply:
|
||||
active: true
|
||||
UnnecessaryInheritance:
|
||||
|
|
@ -389,7 +390,7 @@ style:
|
|||
allowedNames: "(_|ignored|expected|serialVersionUID)"
|
||||
UseDataClass:
|
||||
active: true
|
||||
excludeAnnotatedClasses: ""
|
||||
ignoreAnnotated: []
|
||||
UtilityClassWithPublicConstructor:
|
||||
active: false
|
||||
VarCouldBeVal:
|
||||
|
|
|
|||
Loading…
Reference in New Issue