Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
aldex32 opened this issue Oct 8, 2023 · 3 comments
Labels

Comments

@aldex32
Copy link

aldex32 commented Oct 8, 2023

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!

@blacelle
Copy link
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).

@asomov
Copy link

asomov commented Sep 10, 2024

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

@blacelle
Copy link
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
Labels
Projects
None yet
Development

No branches or pull requests

4 participants