Skip to content

Is it possible to limit yaml formatting to just indentation and preserving empty lines #1853

Open

Description

@aldex32

Hello,
my question is whether it is possible to limit yaml formatting to just indentation and preserving empty lines. In other words if it's possible to avoid using jackson and sneakyaml, since they have some limitations as mentioned #1478 (comment)

Thanks!

Activity

  1. blacelle commented on Sep 10, 2024

    @blacelle
    Contributor

    Jackson has indeed limitation, amongst which comments removal (#1795).

    SnakeYAML might be the way to go for this need. (I suspect indentation-only is not that simple, and preserving empty-lines would be an option).

  2. asomov commented on Sep 10, 2024

    @asomov

    @aldex32 where did you find any SnakeYAML limitations? The above mentioned issue does not contain any limitations for SnakeYAML

  3. blacelle commented on Sep 10, 2024

    @blacelle
    Contributor

    https://github.com/google/yamlfmt may also be the way to go to circumvent current Jackson limitations.


    @asomov I believe the only limitation is the lack of contribution around SnakeYAML into Spotless. Such a formatter would circumvent many of current issues around Jackson (even it is based on SnakeYAML).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions