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

ymlfxr removes comments from yaml files #2

Open
jayvdb opened this issue Jul 8, 2023 · 3 comments
Open

ymlfxr removes comments from yaml files #2

jayvdb opened this issue Jul 8, 2023 · 3 comments

Comments

@jayvdb
Copy link
Collaborator

jayvdb commented Jul 8, 2023

There are quite a few YAML features not supported by https://github.com/chyh1990/yaml-rust that are mentioned in the issues there, and there seems to be a maintenance problem there also (chyh1990/yaml-rust#160), but I think it is worth calling out that comments are lost. chyh1990/yaml-rust#146 is the upstream issue for that.

@jayvdb
Copy link
Collaborator Author

jayvdb commented Jul 8, 2023

IMO it would be worth adding support for another YAML lib if we can find one which supports comments - probably the libyaml based crates. Then the ymlfxr can choose which sets of yaml features they need.

@xbcsmith
Copy link
Owner

xbcsmith commented Jul 8, 2023

I am good with figuring out how to preserve comments. The main goal of the project was to format yaml to pass yamllint without doing anything. As long as we meet that I am fine figuring something out.

@jayvdb
Copy link
Collaborator Author

jayvdb commented Jul 10, 2023

Ya, I agree with you. That removes libyaml crate as an option due to yaml/libyaml#224 . c.f. dtolnay/serde-yaml#337 where we've found that https://github.com/pantoniou/libfyaml may be a solution.

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

No branches or pull requests

2 participants