Repository navigation
Update dependency com.google.googlejavaformat:google-java-format to v2 - #1025
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.36.1→2.0.0Release Notes
google/google-java-format (com.google.googlejavaformat:google-java-format)
v2.0.0Compare Source
google-java-format 2.0.0 replaces the formatter's layout engine, and makes some improvements to lambda formatting (#19). This release also adds an optional cleanup pass that makes small non-whitespace changes, which is enabled by default.
Because of these changes, 2.0.0 reformats more existing code than a typical release. We recommend reformatting your codebase in a single commit when upgrading.
Formatting changes
A lambda that is the only argument of a call is now kept on the same line as the call, instead of starting on a new line with an extra level of indentation (#19):
Text blocks are now indented as part of the main formatting pass, so their indentation is correct even with
--skip-reflowing-long-strings.Fixed indentation of comments after
assert, enum constants,forinitializers,tryresources, multi-catch clauses, and type arguments.Cleanups
Added a
--cleanupflag, enabled by default, for small non-whitespace changes:@Foo()→@Foo)(x) -> ...→x -> ...) (#762)Cleanups only apply to the ranges being formatted. Use
--cleanup=falseto only change whitespace (and the existing--skip-sorting-imports,--skip-removing-unused-imports, and--skip-reordering-modifiersflags for the other non-whitespace changes).When formatting a range with
--linesor--offsetand cleanups enabled, unformatted statements outside the range are re-indented to match the formatted output, so an edit that adds or removes a level of nesting doesn't leave the surrounding code misaligned. Blank lines left behind by cleanups are removed.Configuration
--max-line-length=Nsets the column limit (default 100) (#425). (This flag was introduced in v1.37.0)Language support
Javadoc
*/(#67).<pre>{@code ...}blocks without leading*.Long strings
--linesor--offset, only long string literals in the requested range are reflowed (#1114).\\tin a Windows path or a regular expression) are no longer split when reflowing long string literals (#1186, #1253, #1439).Other fixes
NoClassDefFoundErrorsince 1.36.0 because the plugin didn't bundlecommonmark(#1428).--dry-runwith--replacenow names the right flag (#1094).API changes
JavaFormatterOptions.Builder.cleanup(boolean)controls the new cleanup pass, and defaults totrue. This meansFormatter.formatSourcenow makes the non-whitespace changes listed above by default. Integrations that format code the user is editing, e.g. format-on-save in an IDE, should setcleanup(false); the IntelliJ plugin does this.Formatter.getFormatReplacementsis now strictly whitespace-only: it no longer reorders modifiers, and never applies cleanups. UseFormatter.formatSource(String, Collection<Range<Integer>>)to format character ranges with modifier reordering.JavaFormatterOptions.Stylebecame a record in 1.37.0. The enum-compatible methods, such asStyle.valueOf(String), have been restored for tools like Spotless that called them (#1478).com.google.googlejavaformat.Doc,OpsBuilder, and related types) are no longer used to format Java, but are still included for other formatters that build on them.Full Changelog: google/google-java-format@v1.37.0...v2.0.0
v1.37.0Compare Source
Changes:
--max-line-lengthflag (#425)c51d691,ecba4fb)--google-styleand--style=google|aospflags for easier switching between Google and AOSP style (#1415)Full Changelog: google/google-java-format@v1.36.1...v1.37.0
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.