google-java-format icon indicating copy to clipboard operation
google-java-format copied to clipboard

Reformats Java source code to comply with Google Java Style.

Results 223 google-java-format issues
Sort by recently updated
recently updated
newest added

When using the IntelliJ google-java-formatter 1.16.0.2 with the AOSP style, the "Optimize Imports" action results in empty lines between imports with different TLDs. ### Given: ```java // ... import static...

IntelliJ

I would like to run `google-java-format` in an (open source) project which uses Bazel as build system. I currently have it set up using https://github.com/dustinsand/pre-commit-jvm (with https://pre-commit.com) but it strikes...

I am trying to enable plugin for remote development, but it does not work. I installed the plugin for both host and client side, add all needed properties to `Custom...

IntelliJ

Is it possible to format files in a folder recursively? I tried: java -jar google-java-format-1.19.2-all-deps.jar -replace "folder/extra/*", but it formats only files within this folder and does not format files...

#981 introduced [JEP-430](https://openjdk.org/jeps/430) / [JEP-459](https://openjdk.org/jeps/459) _String Templates_ support. This works great (~leaves it alone) for "single line", e.g. `var html = STR."";` However [when exploring using this](https://github.com/enola-dev/enola/blob/719a747f1d89c6bc362e6282f986c364b56e5a7a/web/ui/src/main/java/dev/enola/web/ui/ThingUI.java#L37) for `"""` Multi-Line...

Comments at the end of this `if` makes the `then` block to not get indented. ``` if (prd.source() .isPresent()) // exclude generated productions like casts prd = null; ``` ![image](https://github.com/google/google-java-format/assets/5113255/80c7017d-27fb-4331-91f4-bee5394f2b60)...

My Java files are not being formatted on save, only when I do a reformat manually. I can see that the google-java-format plugin is running when I save the file...

IntelliJ

In the latest version of IntelliJ IDEA it's a little different and we can also include shortcuts to help people. Step 1: ![image](https://github.com/google/google-java-format/assets/59066707/0326f13c-3cd5-4c02-a446-91ed98f62f10) Step 2: ![image](https://github.com/google/google-java-format/assets/59066707/c5440788-b0b6-453d-8581-3fbf3bee4fda) Step 3: ![image](https://github.com/google/google-java-format/assets/59066707/37181e2b-98ba-4579-af75-db3166b64190) [IntelliJIDEA_ReferenceCard](https://resources.jetbrains.com/storage/products/intellij-idea/docs/IntelliJIDEA_ReferenceCard.pdf)

Using v1.18.1 plugins for Eclipse and IntelliJ, but there is difference in imports order for both IDEs. Imports layouts for Eclipse: ![eclipse_import_layout](https://github.com/google/google-java-format/assets/29916082/09378a53-2b38-488f-968a-529da590c5fe) Imports layouts for IntelliJ: ![idea_import_layout](https://github.com/google/google-java-format/assets/29916082/0d90c902-617b-48bd-af7a-89a21f1f894f) Imports in IntelliJ:...

My code use some preview feature, such as string template. the code likes below ```java throw new IllegalArgumentException(STR."place:\{placeOrg.getName()},\{yearMonth}"); ``` the error message is below ``` google-java-format failed. Does SchedulingAutomateFacade.java have...

IntelliJ