-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Update yaml format in docs #1496
Conversation
`bundle exec rake reformat_yaml` Annoyingly... the standard YAML dump library used by Ruby doesn't provide a lot of formatting options (pretty much just indentation)
Comments were lost due to the parser not caring about them. We can manually go through and restore comments.
Reformatting to standardize yaml format as mentioned in #1493 |
Could faker/CONTRIBUTING.md and faker/lib/locales/en/README.md be update to reflect this new standard? |
should we restore the comments? or leave it as is? |
Is it just me, or did a lot of indentation get messed up? See https://github.com/stympy/faker/blob/5c5a66191de3cb4caf713d7ca47086210f1e46d3/lib/locales/tr.yml for an example. |
@SpyMaster356 I'm all for keeping the comments, if they were useful. I skimmed but didn't see what kinds of comments were lost. Could you point me at an example? |
lib/locales/en/myst.yml
Outdated
creatures: [ "squee", "sunner", "wahrks", "ytrams", "scarab beetles", "bahro", "karnaks", "Mangree", "Zeftyr" ] | ||
characters: [ "The Stranger", "Atrus", "Sirrus", "Achenar", "Gehn", "Catherine", "Saavedro", "Yeesha", "Esher", "Atrius", "Ti'ana" ] | ||
ages: [ | ||
# Myst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stympy here's some comments that were lost
Apparently that indentation is what the YAML writer generates and unfortunately the stdlib YAML parser doesn't support many formatting options (or they weren't easily found in the documentation) |
I'd rather leave the existing YAML as-is and just change the documentation to encourage the preferred format for future YAML. |
sounds good to me, let me revert the changes to the yml files. I'll keep the reformatting rake task in though |
Changes made, should be good now? |
Looking good, thanks! |
Added a rake task to run all the yaml files through the parser then output them back in place:
bundle exec rake reformat_yaml
Annoyingly... the standard YAML dump library used by Ruby doesn't provide a lot of formatting options (pretty much just indentation). We can have a look at using another dumping library if we really want to change the format.
One big thing to note is that all comments were lost due to the parser not caring about them. We can manually go through and restore comments.