• Home
  • Raw
  • Download

Lines Matching +full:google +full:- +full:java +full:- +full:format

1 # google-java-format  chapter
3 `google-java-format` is a program that reformats Java source code to comply with
4 [Google Java Style][].
6 [Google Java Style]: https://google.github.io/styleguide/javaguide.html
10 ### from the command-line
12 [Download the formatter](https://github.com/google/google-java-format/releases)
16 java -jar /path/to/google-java-format-${GJF_VERSION?}-all-deps.jar <options> [files...]
19 The formatter can act on whole files, on limited lines (`--lines`), on specific
20 offsets (`--offset`), passing through to standard-out (default) or altered
21 in-place (`--replace`).
24 [`google-java-format-diff.py`](https://github.com/google/google-java-format/blob/master/scripts/goo…
28 a single format.*
33 [JEP 396: Strongly Encapsulate JDK Internals by Default](https://openjdk.java.net/jeps/396):
36 java \
37 --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
38 --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
39 --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
40 --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
41 --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
42 -jar google-java-format-${GJF_VERSION?}-all-deps.jar <options> [files...]
48 [google-java-format IntelliJ plugin](https://plugins.jetbrains.com/plugin/8527)
51 for the `google-java-format` plugin, and click the `Install` button.
54 to `File→Settings...→google-java-format Settings` (or `IntelliJ
55 IDEA→Preferences...→Other Settings→google-java-format Settings` on macOS) and
56 check the `Enable google-java-format` checkbox. (A notification will be
63 triggered from the `Code` menu or with the Ctrl-Alt-L (by default) keyboard
68 [IntelliJ Java Google Style file](https://raw.githubusercontent.com/google/styleguide/gh-pages/inte…
73 The latest version of the `google-java-format` Eclipse plugin can be downloaded
74 from the [releases page](https://github.com/google/google-java-format/releases).
76 [drop-ins folder](http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fre…
79 The plugin adds a `google-java-format` formatter implementation that can be
80 configured in `Window > Preferences > Java > Code Style > Formatter > Formatter
83 ### Third-party integrations
86 * [spotless](https://github.com/diffplug/spotless/tree/main/plugin-gradle#google-java-format)
87 …* [sherter/google-java-format-gradle-plugin](https://github.com/sherter/google-java-format-gradl…
89 * [spotless](https://github.com/diffplug/spotless/tree/main/plugin-maven#google-java-format)
90 * [coveo/fmt-maven-plugin](https://github.com/coveo/fmt-maven-plugin)
91 … * [talios/googleformatter-maven-plugin](https://github.com/talios/googleformatter-maven-plugin)
92 * [Cosium/maven-git-code-format](https://github.com/Cosium/maven-git-code-format):
93 A maven plugin that automatically deploys google-java-format as a
94 pre-commit git hook.
96 * [sbt/sbt-java-formatter](https://github.com/sbt/sbt-java-formatter)
97 * [maltzj/google-style-precommit-hook](https://github.com/maltzj/google-style-precommit-hook):
98 A pre-commit (pre-commit.com) hook that will automatically run GJF whenever
101 * [googlejavaformat-action](https://github.com/axel-op/googlejavaformat-action):
102 Automatically format your Java files when you push on github
106 The formatter can be used in software which generates java to output more
107 legible java code. Just include the library in your maven/gradle/etc.
114 <groupId>com.google.googlejavaformat</groupId>
115 <artifactId>google-java-format</artifactId>
116 <version>${google-java-format.version}</version>
124 implementation 'com.google.googlejavaformat:google-java-format:$googleJavaFormatVersion'
130 ```java
136 ```java
143 `com.google.googlejavaformat.java.Formatter`.
158 Copyright 2015 Google Inc.
164 http://www.apache.org/licenses/LICENSE-2.0