google-java-formatter: Document how to set up Eclipse plugin

Now that upstream released Eclipse plugin for google-java-formatter
code formatter: [1], document how to set it up and running.

[1] https://github.com/google/google-java-format/pull/118

Contributed-By: Liam Miller-Cushon <cushon@google.com>
Contributed-By: Christian Stein <sormuras@gmail.com>
Change-Id: I48c6fc8b37f2fc7f5236fcdbe2f429f2396943be
This commit is contained in:
David Ostrovsky 2017-02-09 22:13:44 +01:00 committed by David Pursehouse
parent 9204602888
commit 248b709cd1
2 changed files with 11 additions and 7 deletions

View File

@ -144,7 +144,7 @@ by clicking the 'Obtain Password' link on the
link:https://gerrit-review.googlesource.com/#/settings/http-password[HTTP
Password tab of the user settings page].
[[style]]
=== Style
Gerrit generally follows the

View File

@ -45,12 +45,16 @@ Filters on a folder, they will be overwritten the next time you run
[[Formatting]]
== Code Formatter Settings
Import `tools/GoogleFormat.xml` using Window -> Preferences ->
Java -> Code Style -> Formatter -> Import...
This will define the 'Google Format' profile, which the project
settings prefer when formatting source code.
To format source code, Gerrit uses the
link:https://github.com/google/google-java-format[`google-java-format`]
tool (version 1.3), which automatically formats code to follow the
style guide. See link:dev-contributing.html#style[Code Style] for the
instruction how to set up command line tool that uses this formatter.
The Eclipse plugin is provided that allows to format with the same
formatter from within the Eclipse IDE. See
link:https://github.com/google/google-java-format#eclipse[Eclipse plugin]
for details how to install it. It's important to use the same plugin version
as the `google-java-format` script.
== Site Initialization