plugins { `kotlin-dsl` // When updating, update below in dependencies too id("com.diffplug.spotless") version "6.25.0" } repositories { mavenCentral() gradlePluginPortal() mavenLocal() } dependencies { // When updating, update above in plugins too implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0") implementation("net.ltgt.gradle:gradle-errorprone-plugin:4.1.0") implementation("net.ltgt.gradle:gradle-nullaway-plugin:2.1.0") implementation("com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.18.2") } spotless { kotlinGradle { ktlint().editorConfigOverride(mapOf( "indent_size" to "2", "continuation_indent_size" to "2", "max_line_length" to "160", "insert_final_newline" to "true", "ktlint_standard_no-wildcard-imports" to "disabled", // ktlint does not break up long lines, it just fails on them "ktlint_standard_max-line-length" to "disabled", // ktlint makes it *very* hard to locate where this actually happened "ktlint_standard_trailing-comma-on-call-site" to "disabled", // depends on ktlint_standard_wrapping "ktlint_standard_trailing-comma-on-declaration-site" to "disabled", // also very hard to find out where this happens "ktlint_standard_wrapping" to "disabled" )) target("**/*.gradle.kts") } }