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

Please provide output format settings #33

Closed
Vampire opened this issue Aug 24, 2020 · 5 comments
Closed

Please provide output format settings #33

Vampire opened this issue Aug 24, 2020 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed state:waiting for response Waiting for response from submitter

Comments

@Vampire
Copy link

Vampire commented Aug 24, 2020

It would be nice if it were possible to be able to influence output format settings like indentation depth, width for line-breaks and similar. Not everyone is happy with SnakeYamls defaults. :-)

@charleskorn
Copy link
Owner

Hey @Vampire, thanks for the feedback. Do these correspond with snakeyaml's setIndent and setWidth methods on DumpSettingsBuilder, or are you after something else?

@charleskorn charleskorn added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Aug 25, 2020
@Vampire
Copy link
Author

Vampire commented Aug 25, 2020

I guess so, I'm not familiar with SnakeYaml, but I'd like to be able to configure everything format-related the underlying emitter supports.
I'm for example using kaml to read in a GitHub workflow file that has many anchors in it which is not supported by GitHub yet.
But I would need many repetition without anchors and I don't like that.
So I used anchors and now use kaml to read in the file and thereby resolve the anchors and then write out the file again.
So I'm not producing some protocol payload but a file that is checked into version control.
And with the default settings, this file looks not too nice.
By being able to change the output options I hope being able to produce a bit better readable result.

@charleskorn
Copy link
Owner

@Vampire I've added support for both of those settings, and I'll release a new version soon. Please take a look and let me know if there are further options you would like to see.

@charleskorn charleskorn added the state:waiting for response Waiting for response from submitter label Aug 30, 2020
@bristermitten
Copy link
Contributor

To build on this, it would be nice if we could customise the output style of sequences (between block style and flow style).
The system I'm working on expects them in flow style, so unit tests fail (since they literally compare the yaml contents)

I appreciate this isn't a fault of Kaml, but it would be a nice option to have nonetheless

@charleskorn
Copy link
Owner

Given there's been no activity on this issue for a while and two PRs have been merged for it, I'm going to go ahead and close this issue. If there are other formatting options you'd like to see, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed state:waiting for response Waiting for response from submitter
Projects
None yet
Development

No branches or pull requests

3 participants