🌐
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 ... as --aosp, --fix-imports-only, --skip-sorting-imports, --skip-removing-unused-import, --skip-reflowing-long-strings, --skip-javadoc-formatting, or the --dry-run and --set-exit-if-changed. Using @<filename> reads options and filenames from a file, instead of arguments. To reformat changed lines in a specific patch, use google-java-form...
Author: google
🌐
GitLab
gitlab.com › aosp mirror › platform › external › google-java-format
AOSP mirror / platform / external / google-java-format · GitLab
google-java-format · Project information · README · Apache License 2.0 · CONTRIBUTING · Created on · October 13, 2023 · Loading
🌐
GitHub
github.com › google › google-java-format › issues › 319
google-java-format import sorting for AOSP · Issue #319 · google/google-java-format
November 12, 2018 - google-java-format supports the --aosp flag, which formats 4 spaces (instead of the default 2 spaces). AOSP style guide recommends a AOSP specific way to sort imports. If the team open to contribution to extend ImportOrderer to support A...
Author: google
🌐
GitHub
github.com › google › google-java-format › pull › 251 › files › 002651f0f5611085171a35e7699f625f9b7fdc90
This adds an AOSP formatter to the Eclipse plugin. by bryanschofield · Pull Request #251 · google/google-java-format
The google-java-format acts just the same. A new aosp-java-format enables AOSP options. Internally this is achieved by giving the SnippetFormatter the ability to accept JavaFormatterOptions.
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
Copy <plugin> <groupId>com.diffplug.spotless</groupId> <artifactId>spotless-maven-plugin</artifactId> <version>2.30.0</version> <executions> <execution> <goals> <goal>check</goal> </goals> </execution> </executions> <configuration> <java> <googleJavaFormat> <version>1.7</version> <style>AOSP</style> </googleJavaFormat> <removeUnusedImports /> <licenseHeader> <file>../license-header</file> </licenseHeader> </java> </configuration> </plugin> Am I missing something? Aren't they supposed to work with google format (which should be the same...)?
🌐
Pantsbuild
pantsbuild.org › subsystems › google-java-format
google-java-format | Pantsbuild
Use AOSP style instead of Google Style (4-space indentation). ("AOSP" is the Android Open Source Project.) --[no-]google-java-format-skip PANTS_GOOGLE_JAVA_FORMAT_SKIP
🌐
GitHub
github.com › google › google-java-format › blob › master › core › src › main › java › com › google › googlejavaformat › java › JavaFormatterOptions.java
google-java-format/core/src/main/java/com/google/googlejavaformat/java/JavaFormatterOptions.java at master · google/google-java-format
public record JavaFormatterOptions(boolean formatJavadoc, boolean reorderModifiers, Style style) { public JavaFormatterOptions { requireNonNull(style, "style"); } · public enum Style { /** The default Google Java Style configuration. */ GOOGLE(1), · /** The AOSP-compliant configuration.
Author: google
🌐
GitHub
github.com › google › google-java-format › actions › runs › 18785970444 › job › 53604192391
Add support for AOSP formatting in the Eclipse plugin · google/google-java-format@39b6212
Reformats Java source code to comply with Google Java Style. - Add support for AOSP formatting in the Eclipse plugin · google/google-java-format@39b6212
Author: google
🌐
Android Open Source Project
source.android.com › docs › setup › contribute › code-style
AOSP Java code style for contributors | Android Open Source Project
March 13, 2025 - Every file should have a copyright statement at the top, followed by package and import statements (each block separated by a blank line), and finally the class or interface declaration. In the Javadoc comments, describe what the class or interface does.
Find elsewhere
🌐
GitHub
github.com › diffplug › spotless › issues › 2071
Maven: Inconsistent formatting of Java (google AOSP style) with plugin and google-java-format.jar · Issue #2071 · diffplug/spotless
March 19, 2024 - As an extra test, I downloaded the google-java-format jar for v1.21.0 ran java -jar /tmp/google-java-format-1.21.0-all-deps.jar -r --aosp OpenApiConfig.java and it does no modifications after reformatting with intellij plugin:
Author: diffplug
🌐
GitHub
github.com › diffplug › spotless › pull › 193 › files
Support for google-java-format's style option (AOSP style) by ohorn · Pull Request #193 · diffplug/spotless
The google-java-format CLI exposes an option --aosp to switch from the default Google Java Style to AOSP-compliant style (4-space indentation). Such a configuration option is missing from Spotless.
Author: diffplug
🌐
GitHub
github.com › google › google-java-format › wiki › FAQ
FAQ · google/google-java-format Wiki · GitHub
Most options are used only to switch entire behaviors on or off. (The primary exception is --aosp which allows the tool to be used with AOSP code, but inside Google this option is never surfaced through all the various integrations.)
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
binary = which('google-java-format') or '/usr/bin/google-java-format' base_command = [binary] · if args.i: base_command.append('-i') if args.aosp: base_command.append('--aosp') if args.skip_sorting_imports: base_command.append('--skip-sorting-imports') if args.skip_removing_unused_imports: base_command.append('--skip-removing-unused-imports') if args.skip_javadoc_formatting: base_command.append('--skip-javadoc-formatting') ·
Author: google
🌐
GitHub
github.com › google › google-java-format › issues › 179
google-java-format Eclipse plugin does not provide AOSP Style option as google-java-format IntelliJ plugin · Issue #179 · google/google-java-format
August 21, 2017 - The google-java-format Eclipse plugin works in Eclipse IDE for Java Developers Version: Oxygen Release (4.7.0) Build id: 20170620-1800 But it does not provide AOSP Style option. Is this intentional design? Most members of my team like AO...
Author: google
🌐
tr ouwens
jqno.nl › post › 2024 › 08 › 24 › why-are-there-no-decent-code-formatters-for-java
Why are there no decent code formatters for Java? - tr ouwens
August 24, 2024 - Thankfully, the one configuration option that they have, allows you to use 4 spaces instead. This option is called AOSP for Android Open Source Project because when Google acquired it, Android had been using 4 spaces like any sane Java shop.
🌐
Medium
medium.com › @alexprut › integrate-google-java-style-guide-in-a-java-project-567abb6d7987
Integrate Google Java Style Guide in a Java project | by Alex Prut | Medium
July 28, 2019 - As an example in this tutorial, ... definition, Google developed thegoogle-java-format program that reformats the Java source code to comply with the coding style....