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

Add enough primitives to support comment preservation #566

Open
SamSaffron opened this issue Jul 19, 2022 · 0 comments
Open

Add enough primitives to support comment preservation #566

SamSaffron opened this issue Jul 19, 2022 · 0 comments

Comments

@SamSaffron
Copy link

Preserving comments in YAML files is a general problem many automation tools have.

The general problem is that you have some YAML file say:

# the answer
- universe: 41

When you decide to programmatically change the file to correct the answer by loading and saving YAML you end up stripping comments

- universe: 42

There are 2 current families of solutions in the wild. The first is regex hacking. The second is leaning on https://pypi.org/project/ruamel.yaml/.

Was wondering if having enough internal primitives in psych to implement this is a good idea? Should comment preservation be built into Psych (optionally) or is this the role of some other gem that consumes it?

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

No branches or pull requests

1 participant