Add blank line before items with comments
Should probably be a builder option, but it makes the file look prettier.
One of the pillars of Jankson has always been to preserve as much of the "original" file structure as possible, and one way we've been failing so far is line breaks.
I know this isn't quite what you're asking, and perhaps we want a more automatic formatting option for this too, but the Document API as it's sketched out right now includes a FormattingElement.LINE_BREAK that you can insert anywhere in the document to effect a newline, and you can scan the document to detect the newlines and comments.
If we do decide to automate this, I think it makes sense to make it a post-process, pre-serialization step to transform the document (or a copy of the document) so that it conforms to the style. That way we can be intentional about how much we mangle user input. Obviously if you're saving out a serialized POJO for the first time, this is highly desirable. Loaded config file, less so, and you might have both cases in the same application. I don't know, it's worth thinking about and maybe promoting to a full thread over on the Discussions tab.