Flexmark arbitrary formatter options in maven/gradle config by bentatham · Pull Request #2968 · diffplug/spotless (original) (raw)

and others added 5 commits

June 9, 2026 13:18

@bentatham @claude

…ns map

Adds a flexmarkOptions map to FlexmarkConfig and the Maven plugin's Flexmark class. Each camelCase key (e.g. rightMargin) is converted to SCREAMING_SNAKE_CASE and resolved to a static DataKey field on the flexmark Formatter class via reflection. Integer, Boolean, and String option types are supported; an unknown key or unsupported type fails the build with a clear error message.

Example Maven configuration: 100

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

@bentatham @claude

Adds unit tests in FlexmarkStepTest verifying:

Adds a Maven integration test in FlexmarkMavenTest verifying the flexmarkOptions XML map configuration round-trips correctly through the plugin.

Adds the corresponding test resource fixtures FlexmarkOptionsUnformatted.md / FlexmarkOptionsFormatted.md.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

@bentatham @claude

…camelCase conversion to Maven plugin

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

@bentatham @claude

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

@bentatham @claude

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

nedtwigg

@bentatham

@bentatham

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

[ Show hidden characters]({{ revealButtonHref }})