Add support for prince-of-space Java formatter#2991
Draft
agustafson wants to merge 3 commits into
Draft
Conversation
Adds io.princeofspace prince-of-space as a Java FormatterStep, following the same JarState + reflection glue pattern used for palantir-java-format and google-java-format. Wires it into the Gradle (princeOfSpace()) and Maven (<princeOfSpace>) plugins with all of prince-of-space's FormatterConfig knobs exposed (indentStyle, indentSize, lineLength, wrapStyle, closingParenOnNewLine, trailingCommas, javaLanguageLevel).
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.
Summary
Adds prince-of-space as a supported Java formatter, following the same
JarState+ reflection glue pattern used forpalantir-java-formatandgoogle-java-format.lib: newPrinceOfSpaceStep(lib/src/main/java/com/diffplug/spotless/java/PrinceOfSpaceStep.java) and glue class (lib/src/princeOfSpace/java/com/diffplug/spotless/glue/pos/PrinceOfSpaceFormatterFunc.java), wired into a newprinceOfSpacesource set inlib/build.gradle, withprince-of-space-coreadded togradle/libs.versions.tomlplugin-gradle:princeOfSpace()/princeOfSpace(version)DSL on thejava {}extension (JavaExtension.java), with all of prince-of-space'sFormatterConfigknobs exposed as fluent setters (indentStyle,indentSize,lineLength,wrapStyle,closingParenOnNewLine,trailingCommas,javaLanguageLevel)plugin-maven: matching<princeOfSpace>step (PrinceOfSpace.java, wired intoJava.java)PrinceOfSpaceStepTestcovering formatting behavior, option overrides, and serialization equalitylib,plugin-gradle, andplugin-mavenCloses #2990
Test plan
:lib:compileJavaand the newprinceOfSpaceglue source set compile cleanly, resolvingprince-of-space-core:2.1.2from Maven Central./gradlew test(couldn't runtestlib/plugin-gradle/plugin-mavenin my sandbox —lib-extra's p2/Eclipse dependency resolution was blocked by my environment's network policy, unrelated to this change; should run clean in CI)./gradlew spotlessApply/./gradlew spotbugsMainChecklist
[Unreleased]CHANGES.md entries' link to this PR (perPULL_REQUEST_TEMPLATE.md) once it's opened