fix #1076: Add support for palantir-java-format#1083
fix #1076: Add support for palantir-java-format#1083nedtwigg merged 15 commits intodiffplug:mainfrom
Conversation
Both versions tested are compatible with java 8
|
It looks like |
nedtwigg
left a comment
There was a problem hiding this comment.
You've gotta pick whether you're staying compatible with GJF or going your own way :)
lib/src/main/java/com/diffplug/spotless/java/PalantirJavaFormatStep.java
Outdated
Show resolved
Hide resolved
lib/src/main/java/com/diffplug/spotless/java/PalantirJavaFormatStep.java
Outdated
Show resolved
Hide resolved
lib/src/main/java/com/diffplug/spotless/java/PalantirJavaFormatStep.java
Outdated
Show resolved
Hide resolved
|
That's fair, I can remove the extra bits, and trim down the API :-) |
Support for non-default styles and alternative artifacts have been dropped in favor simplicity. If requested, we can add support for reflowing strings in the future.
|
Thanks for the review! |
|
I'm gonna give this ~24hrs in case anyone else wants to weigh-in and then I'll merge and release. |
|
Welp, jcenter is down today (semi-scheduled), which has brought the Gradle plugin portal down. https://discuss.gradle.org/t/plugins-redirecting-to-jcenter/41909/4 This PR is confirmed to pass all tests before the Gradle outage, so I'm moving forward with merging. |
|
Released in |
What
palantir-java-format is a modern, lambda-friendly, 120 character Java formatter based on the excellent google-java-format, and benefits from the work of all the original authors. palantir-java-format is available under the same (Apache 2.0 License)[https://github.com/palantir/palantir-java-format/blob/develop/LICENSE].
Examples from the readme
(1) before:
(1) after:
(2) before:
(2) after:
How
This implementation is nearly identical to the google-java-format implementation, given that palantir-java-format is a fork! I've avoided coupling the implementations, as that's more likely to cause harm than help, especially given the logic around version checks for supported features.
One difference between the implementations is that I have opted not to support reflowing strings. Currently the palantir-java-format library does not expose the reflowing method as public API, so it would have to be implemented using a different method such as Formatter.formatSourceAndFixImports.
PR metadata
[Unreleased]section of CHANGES.md, plugin-gradle/CHANGES.md, and plugin-maven/CHANGES.md which includes:[] a link to the issue you are resolving (for small changes)plugin-foo/CHANGES.mdfor that plugin. If your change affects lib in an end-user-visible way (fixing a bug, updating a version) then you need to updateCHANGES.mdfor both the lib and all build plugins. Users of a build plugin shouldn't have to refer to lib to see changes that affect them.