rubyvideo icon indicating copy to clipboard operation
rubyvideo copied to clipboard

Normalize yml files

Open adrienpoly opened this issue 9 months ago • 0 comments

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 of description: |- multiline format not sure why

adrienpoly avatar Mar 06 '25 14:03 adrienpoly