From 4bafeed66c9c328362e18f6a800061319d055ecf Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Fri, 21 Jul 2023 15:52:59 -0500 Subject: [PATCH] Upgrade more gradle plugin dependencies --- buildSrc/build.gradle.kts | 3 +- .../otel.spotless-conventions.gradle.kts | 36 +++++++++++++++++-- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index b90360a..1bda8f8 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -9,6 +9,5 @@ repositories { } dependencies { - implementation("com.diffplug.spotless:spotless-plugin-gradle:5.16.0") - implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.17") + implementation("com.diffplug.spotless:spotless-plugin-gradle:6.20.0") } diff --git a/buildSrc/src/main/kotlin/otel.spotless-conventions.gradle.kts b/buildSrc/src/main/kotlin/otel.spotless-conventions.gradle.kts index 2133fc4..5aec55a 100644 --- a/buildSrc/src/main/kotlin/otel.spotless-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/otel.spotless-conventions.gradle.kts @@ -22,16 +22,45 @@ spotless { } plugins.withId("org.jetbrains.kotlin.jvm") { kotlin { - ktlint().userData(mapOf("indent_size" to "2", "continuation_indent_size" to "2", "disabled_rules" to "no-wildcard-imports")) + 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" + )) licenseHeaderFile(rootProject.file("buildscripts/spotless.license.java"), "(package|import|class|// Includes work from:)") } } kotlinGradle { - ktlint().userData(mapOf("indent_size" to "2", "continuation_indent_size" to "2", "disabled_rules" to "no-wildcard-imports")) + 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" + )) } format("misc") { // not using "**/..." to help keep spotless fast target( + ".gitignore", ".gitattributes", ".gitconfig", ".editorconfig", @@ -39,7 +68,8 @@ spotless { "src/**/*.md", "docs/**/*.md", "*.sh", - "src/**/*.properties") + "src/**/*.properties", + ) indentWithSpaces() trimTrailingWhitespace() endWithNewline()