google-java-format

Google Java Format (https://github.com/google/google-java-format)

Backend: pants.backend.experimental.java.lint.google_java_format
Config section: [google-java-format]

Basic options

skip

--[no-]google-java-format-skip
PANTS_GOOGLE_JAVA_FORMAT_SKIP
default: False

Don't use Google Java Format when running ./pants fmt and ./pants lint.


aosp

--[no-]google-java-format-aosp
PANTS_GOOGLE_JAVA_FORMAT_AOSP
default: False

Use AOSP style instead of Google Style (4-space indentation). ("AOSP" is the Android Open Source Project.)


Advanced options

version

--google-java-format-version=<str>
PANTS_GOOGLE_JAVA_FORMAT_VERSION
default: 1.13.0

Version string for the tool. This is available for substitution in the [google-java-format].artifacts option by including the string {version}.


artifacts

--google-java-format-artifacts="['<str>', '<str>', ...]"
PANTS_GOOGLE_JAVA_FORMAT_ARTIFACTS
default:
[
  "com.google.googlejavaformat:google-java-format:{version}"
]

Artifact requirements for this tool using specified as either the address of a jvm_artifact target or, alternatively, as a colon-separated Maven coordinates (e.g., group:name:version). For Maven coordinates, the string {version} version will be substituted with the value of the [google-java-format].version option.


lockfile

--google-java-format-lockfile=<str>
PANTS_GOOGLE_JAVA_FORMAT_LOCKFILE
default: <default>

Path to a lockfile used for installing the tool.

Set to the string <default> to use a lockfile provided by Pants, so long as you have not changed the --version option. See https://github.com/pantsbuild/pants/blob/release_2.11.1rc2/src/python/pants/backend/java/lint/google_java_format/google_java_format.default.lockfile.txt for the default lockfile contents.

To use a custom lockfile, set this option to a file path relative to the build root, then run ./pants jvm-generate-lockfiles --resolve=google-java-format.


Deprecated options

None


Did this page help you?