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

Feature request: sort keys on generated yaml #45

Closed
kikito opened this issue Jun 21, 2021 · 2 comments
Closed

Feature request: sort keys on generated yaml #45

kikito opened this issue Jun 21, 2021 · 2 comments

Comments

@kikito
Copy link

kikito commented Jun 21, 2021

I was wondering if it would be possible to add a flag to sort keys in arrays before generating?

@gvvaughan
Copy link
Owner

Hi, there’s no need - you can use the low level emitter interface to send document tokens for keys in any order you’d like. If you need some inspiration for how to implement that, you can start with a copy of dumper_mt in lib/lyaml/init.lua and tweak accordingly. Alternatively, take a look at my Specl project, which also calls the low level interfaces to add line number tracking for displaying nicer error messages.

@kikito
Copy link
Author

kikito commented Jun 22, 2021

Thank you for the directions, I will give this a try.

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