rubyvideo
rubyvideo copied to clipboard
Normalize yml files
While I was looking into adding a task to add slugs to the yml files I realized that mutating yml files isn't that easy.
If we use a basic Yml load/mutate/dump process we loose all comments
I looked into psych-comments gem ran into a few issues and opened a few PR's to the gem.
In the mean time I forked the project and we can use this branch with those extras:
- persist end of lien comments
- ability to mutate leading and trailing comments
- remove frozen string literals warnings
Results
- all comments are normalized, comments blocks have a leading and trailing empty line to separate them
- all description are converted to multiline yml block
description: |-. To prevent strange behaviour when we mutate them down the road
Task
To normalize all yml file one can run this task
rails yml:normalize
~~I think we should replace the current yaml formater in the bin/lint task with that one now~~
Edit this is done now
Todo
- [ ] the description of the children talks remains to be normalized
- [ ] it seems some talk descriptions are still in the
description: ""format instead ofdescription: |-multiline format not sure why