|
|
|
@ -31,7 +31,30 @@ class SpotlessConventionPlugin : Plugin<Project> {
|
|
|
|
|
kotlin {
|
|
|
|
|
target("**/*.kt")
|
|
|
|
|
targetExclude("**/build/**/*.kt")
|
|
|
|
|
ktlint(libs.findVersion("ktlint").get().toString()).userData(mapOf("android" to "true"))
|
|
|
|
|
ktlint(libs.findVersion("ktlint").get().toString())
|
|
|
|
|
.editorConfigOverride(
|
|
|
|
|
mapOf(
|
|
|
|
|
"ktlint_code_style" to "android",
|
|
|
|
|
"ij_kotlin_allow_trailing_comma" to true,
|
|
|
|
|
// These rules were introduced in ktlint 0.46.0 and should not be
|
|
|
|
|
// enabled without further discussion. They are disabled for now.
|
|
|
|
|
// See: https://github.com/pinterest/ktlint/releases/tag/0.46.0
|
|
|
|
|
"disabled_rules" to
|
|
|
|
|
"filename," +
|
|
|
|
|
"annotation,annotation-spacing," +
|
|
|
|
|
"argument-list-wrapping," +
|
|
|
|
|
"double-colon-spacing," +
|
|
|
|
|
"enum-entry-name-case," +
|
|
|
|
|
"multiline-if-else," +
|
|
|
|
|
"no-empty-first-line-in-method-block," +
|
|
|
|
|
"package-name," +
|
|
|
|
|
"trailing-comma," +
|
|
|
|
|
"spacing-around-angle-brackets," +
|
|
|
|
|
"spacing-between-declarations-with-annotations," +
|
|
|
|
|
"spacing-between-declarations-with-comments," +
|
|
|
|
|
"unary-op-spacing"
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
|
|
|
|
|
}
|
|
|
|
|
format("kts") {
|
|
|
|
|