diff --git a/CHANGES.md b/CHANGES.md index f04f8ef124..dbeb53a0a2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -20,6 +20,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * scalafmt.conf fileOverride section now works correctly ([#1854](https://github.com/diffplug/spotless/pull/1854)) ### Changes * Bump default `gherkin-utils` version to latest `8.0.2` -> `9.0.0`. ([#1703](https://github.com/diffplug/spotless/pull/1703)) +* Bump default `google-java-format` version to latest `1.19.2` -> `1.22.0`. ([#2129](https://github.com/diffplug/spotless/pull/2129)) * Bump default `jackson` version to latest `2.14.2` -> `2.17.1`. ([#1685](https://github.com/diffplug/spotless/pull/1685)) * Bump default `ktfmt` version to latest `0.46` -> `0.49`. ([#2045](https://github.com/diffplug/spotless/pull/2045), [#2127](https://github.com/diffplug/spotless/pull/2127)) * Bump default `ktlint` version to latest `1.1.1` -> `1.2.1`. ([#2057](https://github.com/diffplug/spotless/pull/2057)) diff --git a/lib/build.gradle b/lib/build.gradle index ddde01ea59..783f99d288 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -93,7 +93,7 @@ dependencies { gherkinCompileOnly 'io.cucumber:gherkin-utils:9.0.0' gherkinCompileOnly 'org.slf4j:slf4j-api:2.0.0' // googleJavaFormat - googleJavaFormatCompileOnly 'com.google.googlejavaformat:google-java-format:1.19.2' + googleJavaFormatCompileOnly 'com.google.googlejavaformat:google-java-format:1.22.0' // gson gsonCompileOnly 'com.google.code.gson:gson:2.10.1' // jackson diff --git a/lib/src/main/java/com/diffplug/spotless/java/GoogleJavaFormatStep.java b/lib/src/main/java/com/diffplug/spotless/java/GoogleJavaFormatStep.java index 1378ec5c90..8d05e85c61 100644 --- a/lib/src/main/java/com/diffplug/spotless/java/GoogleJavaFormatStep.java +++ b/lib/src/main/java/com/diffplug/spotless/java/GoogleJavaFormatStep.java @@ -121,7 +121,7 @@ private static FormatterStep createInternally(String groupArtifact, String versi .addMin(11, "1.8") // we only support google-java-format >= 1.8 due to api changes .addMin(16, "1.10.0") // java 16 requires at least 1.10.0 due to jdk api changes in JavaTokenizer .addMin(21, "1.17.0") // java 21 requires at least 1.17.0 due to https://github.com/google/google-java-format/issues/898 - .add(11, "1.19.2"); // default version + .add(11, "1.22.0"); // default version public static String defaultGroupArtifact() { return MAVEN_COORDINATE; diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index 2f3491448c..bccb62dcb1 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -15,6 +15,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * scalafmt.conf fileOverride section now works correctly ([#1854](https://github.com/diffplug/spotless/pull/1854)) ### Changes * Bump default `gherkin-utils` version to latest `8.0.2` -> `9.0.0`. ([#1703](https://github.com/diffplug/spotless/pull/1703)) +* Bump default `google-java-format` version to latest `1.19.2` -> `1.22.0`. ([#2129](https://github.com/diffplug/spotless/pull/2129)) * Bump default `jackson` version to latest `2.14.2` -> `2.17.1`. ([#1685](https://github.com/diffplug/spotless/pull/1685)) * Bump default `ktfmt` version to latest `0.46` -> `0.49`. ([#2045](https://github.com/diffplug/spotless/pull/2045), [#2127](https://github.com/diffplug/spotless/pull/2127)) * Bump default `ktlint` version to latest `1.1.1` -> `1.2.1`. ([#2057](https://github.com/diffplug/spotless/pull/2057)) diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index f3073218c1..557e011ac4 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -13,6 +13,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * scalafmt.conf fileOverride section now works correctly ([#1854](https://github.com/diffplug/spotless/pull/1854)) ### Changes * Bump default `gherkin-utils` version to latest `8.0.2` -> `9.0.0`. ([#1703](https://github.com/diffplug/spotless/pull/1703)) +* Bump default `google-java-format` version to latest `1.19.2` -> `1.22.0`. ([#2129](https://github.com/diffplug/spotless/pull/2129)) * Bump default `jackson` version to latest `2.14.2` -> `2.17.1`. ([#1685](https://github.com/diffplug/spotless/pull/1685)) * Bump default `ktfmt` version to latest `0.46` -> `0.49`. ([#2045](https://github.com/diffplug/spotless/pull/2045), [#2127](https://github.com/diffplug/spotless/pull/2127)) * Bump default `ktlint` version to latest `1.1.1` -> `1.2.1`. ([#2057](https://github.com/diffplug/spotless/pull/2057)) diff --git a/testlib/src/main/resources/java/googlejavaformat/TextBlock.clean b/testlib/src/main/resources/java/googlejavaformat/TextBlock.clean index 8ee77fbf7a..bd558ffd96 100644 --- a/testlib/src/main/resources/java/googlejavaformat/TextBlock.clean +++ b/testlib/src/main/resources/java/googlejavaformat/TextBlock.clean @@ -3,7 +3,8 @@ import mylib.UsedB; public class Java { public static void main(String[] args) { - var a = """ + var a = + """ Howdy Partner! """;