Create plugin for linting (#8942)

(cherry picked from commit c31e75f02f3021c52f6c24f655e2bded0c8b2b33)

# Conflicts:
#	.github/workflows/build_pull_request.yml
#	.github/workflows/build_push.yml
#	app/build.gradle.kts
#	build.gradle.kts
This commit is contained in:
Andreas
2023-01-19 04:33:56 +01:00
committed by Jobobby04
parent 50a758f05b
commit 34b60a435e
15 changed files with 50 additions and 41 deletions
@@ -0,0 +1,20 @@
import org.jmailen.gradle.kotlinter.KotlinterExtension
import org.jmailen.gradle.kotlinter.KotlinterPlugin
apply<KotlinterPlugin>()
extensions.configure<KotlinterExtension>("kotlinter") {
experimentalRules = true
disabledRules = arrayOf(
"experimental:argument-list-wrapping", // Doesn't play well with Android Studio
"filename", // Often broken to give a more general name
)
}
tasks {
named<DefaultTask>("preBuild").configure {
if (!System.getenv("CI").toBoolean())
dependsOn("formatKotlin")
}
}