Skip to content

Commit 30f4db6

Browse files
committed
👷 Update Detekt Config
1 parent 00d27fb commit 30f4db6

File tree

3 files changed

+862
-0
lines changed

3 files changed

+862
-0
lines changed

app/build.gradle.kts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
alias(libs.plugins.android.application)
33
alias(libs.plugins.kotlin.android)
4+
id("io.gitlab.arturbosch.detekt").version("1.23.7")
45
id("jacoco")
56
}
67

@@ -117,4 +118,53 @@ tasks.register<JacocoReport>("jacocoTestReport") {
117118
)
118119
)
119120
)
121+
}
122+
123+
detekt {
124+
// Version of detekt that will be used. When unspecified the latest detekt
125+
// version found will be used. Override to stay on the same version.
126+
toolVersion = "1.23.7"
127+
128+
// The directories where detekt looks for source files.
129+
// Defaults to `files("src/main/java", "src/test/java", "src/main/kotlin", "src/test/kotlin")`.
130+
source.setFrom("src/main/java", "src/main/kotlin")
131+
132+
// Builds the AST in parallel. Rules are always executed in parallel.
133+
// Can lead to speedups in larger projects. `false` by default.
134+
parallel = false
135+
136+
// Define the detekt configuration(s) you want to use.
137+
// Defaults to the default detekt configuration.
138+
config.setFrom("detekt.yml")
139+
140+
// Applies the config files on top of detekt's default config file. `false` by default.
141+
buildUponDefaultConfig = false
142+
143+
// Turns on all the rules. `false` by default.
144+
allRules = false
145+
146+
// Disables all default detekt rulesets and will only run detekt with custom rules
147+
// defined in plugins passed in with `detektPlugins` configuration. `false` by default.
148+
disableDefaultRuleSets = false
149+
150+
// Adds debug output during task execution. `false` by default.
151+
debug = false
152+
153+
// If set to `true` the build does not fail when the
154+
// maxIssues count was reached. Defaults to `false`.
155+
ignoreFailures = false
156+
157+
// Android: Don't create tasks for the specified build flavor (e.g. "production")
158+
ignoredFlavors = listOf("production")
159+
160+
// Android: Don't create tasks for the specified build variants (e.g. "productionRelease")
161+
ignoredVariants = listOf("productionRelease")
162+
163+
// Specify the base path for file paths in the formatted reports.
164+
// If not set, all file paths reported will be absolute file path.
165+
basePath = projectDir.absolutePath
166+
167+
dependencies {
168+
detektPlugins(libs.detekt.rules.compose)
169+
}
120170
}

0 commit comments

Comments
 (0)