google-java-format
google-java-format copied to clipboard
Reformats Java source code to comply with Google Java Style.
Please have a look at the following two unit tests which should both work, but only the second does: @Test public void testCharaterRangesFormatWithAnnotation() throws Exception { final String text =...
https://github.com/google/google-java-format/issues/19 The style guide says: "A line is never broken adjacent to the arrow in a lambda, except that a break may come immediately after the arrow if the body...
# Repro: 1. Load the pom.xml file in IntelliJ 2. Attempt to run tests inside IntelliJ Observe: ``` Information:java: An exception has occurred in the compiler (1.8.0_181). Please file a...
The use case is license headers added by, for instance, maven [license](http://www.mojohaus.org/license-maven-plugin/) [plugins](https://github.com/mycila/license-maven-plugin). These headers are not by default formatted in the way that google-java-format requires, and since neither (for...
While not Google's style, several other companies and projects prefer longer line length than 100 chars. My current team evaluated google-java-format, and the most contention issue was the line length...
The annotation is wrong for the Java file, but this is a compiling, small reproducing case. The following file complains about syntax errors: ```java package foo; import groovy.transform.CompileStatic; /** *...
Test case: ```java package test; import com.google.common.util.concurrent.AtomicLongMap; class Foo { AtomicLongMap a = AtomicLongMap.create().getAndIncrement("foo"); } ``` Error: `src/Test.java:6:30: error: expected token: 'getAndIncrement'; generated getAndIncrement instead` Version: google-java-format --version google-java-format: Version...
In code that has string concatenation wrapped on multiple lines, the formatter should remove any redundant concatenations when unwrapping the line. See [this reformatting change on the gerrit project](https://gerrit-review.googlesource.com/#/c/91444/7/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java) for...
I am running google-java-format on a Windows machine. When I provide it a file (with the "@" syntax) containing a list of files to format, it will fail to format...
I created a GitHub action in order to check my code with your standalone jar. I wanted to ask before publishing it in the GitHub marketplace whether this violates your...