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

way to avoid attempts to preserve whitespace? tomlkit not properly preserving newlines #178

Closed
bsferrazza opened this issue Feb 18, 2022 · 0 comments · Fixed by #179
Closed

Comments

@bsferrazza
Copy link

If I have a very simple TOML file like this

description = "this is a test"

[dir.subdir]

and then insert some new key-value pairs and some additional levels of hierarchy, tomlkit squashes everything together when I go to print it, destroying any spaces between sections.

description = "this is a test"
foo = "bar"
mykey = "myvalue"
[dir.subdir]
foo = "bar"
[dir2.subdir2]
foo = "bar"

This is not very readable or the desired output. How can I get tomlkit to place a blank line between each section, to look like this?

description = "this is a test"
foo = "bar"
mykey = "myvalue"

[dir.subdir]
foo = "bar"

[dir2.subdir2]
foo = "bar"

Is there an option to have it avoid trying to preserve whitespace (which it seems to be failing to do here in this example) and dump the output in a conventional format (with a blank line in between sections)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant