On 18-01-2021 14:31, Andrea Aime wrote:
Hi Mark,
thanks! Had a look, looks like an improvement to me, the current
settings seem sensible.
The PR does not really contain the reformatted files, so to see the
difference one has to
check it out and run it locally. Mark, maybe you could put the result of
reformat in a separate commit,
so that if changes are needed, it's possible to wipe it and redo the
formatting? (and then force push).
It would help other devs get a quick "before and after" view.
One thing that I'm a bit hesitant about, is that empty lines are getting
removed. Sometimes these
lines are used to separate blocks, but the semantics of that is in our
head, don't think it's possible
to tell the plugin about it.
As far as I can tell the document is parsed using jdom/sax and then
serialized again, so whitespace without any semantic meaning is removed
https://github.com/acegi/xml-format-maven-plugin/blob/6a50b3243bff5ec602fea4c7fd6021a93e573500/src/main/java/au/com/acegi/xmlformat/FormatUtil.java#L55-L84
basically the options are limited to:
https://dom4j.github.io/javadoc/2.1.3/org/dom4j/io/OutputFormat.html
As another node, I'd suggest trying to run it on the applicationContext
files, they also are all over the place formatting wise.
Tried locally with the following modified config:
<includes>
<include>**/pom.xml</include>
<include>**/applicationContext.xml</include>
<include>**/applicationSecurityContext.xml</include>
</includes>
3 commits now:
1. adding the plugin
2. addding reformatted pom files
3. adding formatting for the Spring context files + reformatted
applicationContext.xml / applicationSecurityContext.xml
I agree it would be nice to have something that limited the maximum line
length in a smart manner.
Alternatively https://code.revelc.net/formatter-maven-plugin/ could be
an option, it requires an Eclipse formatting profile and could much more
that format/check xml files
Mark
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel