Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Cleanup DetektExtension for unnecessary properties (#22)
Browse files Browse the repository at this point in the history
* Build upon default config by default

* Inline extension defaults

* Remove obsolete input parameter
  • Loading branch information
arturbosch authored Sep 13, 2020
1 parent 5217b9b commit e21f364
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 32 deletions.
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ plugins {
detekt {
debug = true
isEnabled = System.getProperty("selfAnalysis") != null
buildUponDefaultConfig = true
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ import java.io.File
open class DetektExtension(project: Project) : CodeQualityExtension() {

var isEnabled: Boolean = true
var baseline: File? = null
var debug: Boolean = false
var parallel: Boolean = false
var failFast: Boolean = false
var buildUponDefaultConfig: Boolean = true
var disableDefaultRuleSets: Boolean = false
var autoCorrect: Boolean = false

var config: ConfigurableFileCollection = project.objects.fileCollection()

var ignoreFailures: Boolean
@JvmName("ignoreFailures_")
Expand All @@ -21,35 +30,4 @@ open class DetektExtension(project: Project) : CodeQualityExtension() {
val reports = DetektReports()

fun reports(configure: Action<DetektReports>) = configure.execute(reports)

var input: ConfigurableFileCollection =
project.objects.fileCollection().from(DEFAULT_SRC_DIR_JAVA, DEFAULT_SRC_DIR_KOTLIN)

var baseline: File? = null

var config: ConfigurableFileCollection = project.objects.fileCollection()

var debug: Boolean = DEFAULT_DEBUG_VALUE

var parallel: Boolean = DEFAULT_PARALLEL_VALUE

var failFast: Boolean = DEFAULT_FAIL_FAST_VALUE

var buildUponDefaultConfig: Boolean = DEFAULT_BUILD_UPON_DEFAULT_CONFIG_VALUE

var disableDefaultRuleSets: Boolean = DEFAULT_DISABLE_RULESETS_VALUE

var autoCorrect: Boolean = DEFAULT_AUTO_CORRECT_VALUE

companion object {
const val DEFAULT_SRC_DIR_JAVA = "src/main/java"
const val DEFAULT_SRC_DIR_KOTLIN = "src/main/kotlin"
const val DEFAULT_DEBUG_VALUE = false
const val DEFAULT_PARALLEL_VALUE = false
const val DEFAULT_AUTO_CORRECT_VALUE = false
const val DEFAULT_DISABLE_RULESETS_VALUE = false
const val DEFAULT_REPORT_ENABLED_VALUE = true
const val DEFAULT_FAIL_FAST_VALUE = false
const val DEFAULT_BUILD_UPON_DEFAULT_CONFIG_VALUE = false
}
}

0 comments on commit e21f364

Please sign in to comment.