You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Braces are used with if, else, for, do and while statements, even when the body is empty or contains only a single statement.
so I'm guessing the fix is in this project ?
I'm using 1.6 through Spotless:
<!-- Spotless is a general-purpose formatting plugin. It is completely à la carte, but also includes powerful "batteries-included" if you opt-in https://github.com/diffplug/spotless/tree/master/plugin-maven -->
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<configuration>
<java>
<removeUnusedImports/>
<googleJavaFormat>
<version>1.6</version>
<!-- Optional, available versions: GOOGLE, AOSP https://github.com/google/google-java-format/blob/master/core/src/main/java/com/google/googlejavaformat/java/JavaFormatterOptions.java -->
<style>GOOGLE</style>
</googleJavaFormat>
</java>
</configuration>
</plugin>
The text was updated successfully, but these errors were encountered:
I ran the latest google-java-format on my codebase and it formatted the code as follows:
The if-conditions on a single line are failing Google's Checkstyle checks https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
Looking at the guide : https://google.github.io/styleguide/javaguide.html#s4.1-braces
It says:
so I'm guessing the fix is in this project ?
I'm using 1.6 through Spotless:
The text was updated successfully, but these errors were encountered: