From d50123c626f40864ae3f75b2597c3e218009b411 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Thu, 16 Apr 2026 13:32:06 +0200 Subject: [PATCH] update README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 778dbd7..ae8fd7f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [sbt-java-formatter][] [![scaladex-badge][]][scaladex] +# sbt-java-formatter [![scaladex-badge][]][scaladex] [sbt-java-formatter]: https://github.com/sbt/sbt-java-formatter [scaladex]: https://index.scala-lang.org/sbt/sbt-java-formatter @@ -30,7 +30,7 @@ For available versions see [releases](https://github.com/sbt/sbt-java-formatter/ * `javafmtFixImportsAll` fixes Java imports only for all configurations (`Compile` and `Test` by default) * `javafmtFixImportsCheck` fails if Java imports need fixing * `javafmtFixImportsCheckAll` fails if Java imports need fixing in any configuration (`Compile` and `Test` by default) - +
* The `javafmtOnCompile` setting controls whether the formatter kicks in on compile (`false` by default). * The `javafmtStyle` setting defines the formatting style: Google Java Style (by default) or AOSP style. * The `javafmtSortImports` setting controls whether imports are sorted (`true` by default). @@ -74,11 +74,11 @@ This is useful if your build runs sbt on one JDK but needs to launch the formatt For example: ```scala -ThisBuild / javafmtFormatterCompatibleJavaVersion := 21 +ThisBuild / javafmtFormatterCompatibleJavaVersion := 17 ``` ```bash -SBT_JAVAFMT_JAVA_HOME=/path/to/jdk-21 sbt javafmt +SBT_JAVAFMT_JAVA_HOME=/path/to/jdk-17 sbt javafmt ``` Use `javafmtJavaMaxHeap` to control the maximum heap size passed to that JVM: @@ -111,7 +111,7 @@ Set any of them to `false` to pass the corresponding `--skip-...` flag to `googl - `11` -> `google-java-format 1.24.0` - `17` -> `google-java-format 1.28.0` -- `21` -> `google-java-format 1.35.0` +- `21` -> `google-java-format 1.35.0` (default) If the selected formatter runtime is newer than the Java used to launch the formatter JVM, either: