GitHub
github.com › google › google-java-format
GitHub - google/google-java-format: Reformats Java source code to comply with Google Java Style. · GitHub
August 14, 2026 - Option --help will print full usage ... from a file, instead of arguments. To reformat changed lines in a specific patch, use google-java-form......
Author: google
GitHub
github.com › google › google-java-format › blob › master › scripts › google-java-format-diff.py
google-java-format/scripts/google-java-format-diff.py at master · google/google-java-format
help='use AOSP style instead of Google Style (4-space indentation)') parser.add_argument('--skip-sorting-imports', action='store_true', help='do not fix the import order') parser.add_argument('--skip-removing-unused-imports', action='store_true', help='do not remove ununsed imports') parser.add_argument( '--skip-javadoc-formatting', action='store_true', default=False, help='do not reformat javadoc') parser.add_argument('-b', '--binary', help='path to google-java-format binary') parser.add_argument('--google-java-format-jar', metavar='ABSOLUTE_PATH', default=None, help='use a custom google-java-format jar') ·
Author: google
Stack Overflow
stackoverflow.com › questions › 76716652 › how-to-get-similar-google-java-formatting-in-intellij-and-with-maven
How to get similar google java formatting in intellij and with maven - Stack Overflow
"Enable google-java-format" is checked in the settings, but how to be sure? ... You could try using other formatting integrations instead of spotless - github.com/google/google-java-format/tree/… or discuss this issue with the google-java-format plugin developer directly at github.com/google/google-java-format/issues
Starred by 119 users
Forked by 30 users
Languages: TypeScript 99.6% | JavaScript 0.4%
Top answer 1 of 2
13
I was able to change to 4-space indentations by selecting the Android Open Source Project (AOSP) style in the google-java-format plugin settings:

It looks like the only difference between the two styles is that AOSP doubles the spacing to 4 instead of 2: https://github.com/google/google-java-format/blob/master/core/src/main/java/com/google/googlejavaformat/java/JavaFormatterOptions.java#L37
2 of 2
6
First I disabled the IntelliJ google-java-format plugin.Downloaded IntelliJ-java-google-style.xml from here and modified indent size property as below. After importing this style in IntelliJ, I am able to indent to 4 spaces. To import the code style XML, please refer to this link
<codeStyleSettings language="CSS">
<indentOptions>
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="4" />
</indentOptions>
</codeStyleSettings>