Handling of SortPom
Hi! I'm the author of SortPom and I just realised that you are using my plugin for sorting the pom file. This is Great! Can I contribute to the integration with Spotless somehow?
More concretely, should SortPom react to any settings that Spotless has, such as encoding or line endings? Or add support for endWithNewline?
PRs welcome :)
Anything special on your wish-list?
should SortPom react to any settings that Spotless has, such as encoding or line endings? Or add support for endWithNewline?
The Spotless value proposition is "if you implement a String -> String function, we will handle the rest" (contributing.md). We handle
- line endings
- encoding
- fix idempotence problems
- combine one function (e.g. sortPom) with other functions (e.g. endWithNewline)
So you don't need to respond to any of our settings. We, however, are obliged to respond to your settings, and this is how we model them:
- https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/pom/SortPomCfg.java
- https://github.com/diffplug/spotless/blob/main/lib/src/sortPom/java/com/diffplug/spotless/glue/pom/SortPomFormatterFunc.java
If there's anything missing, feel free to add it :)
I have updated the SortPom plugin with support for endWithNewline; whether to ensure that sorted pom ends with a newline or not.
I have created a PR in spotless for that version bump: https://github.com/diffplug/spotless/pull/2049 Hope that it can be of some use 😊
PR is merged now, all seems fine. Thanks for your great job around Spotless!! 👋