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

Normalize yml files #644

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Normalize yml files #644

wants to merge 10 commits into from

Conversation

adrienpoly
Copy link
Owner

@adrienpoly adrienpoly commented Mar 6, 2025

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 adrienpoly requested a review from marcoroth March 6, 2025 14:02
@adrienpoly adrienpoly force-pushed the normalize-yml-files branch 4 times, most recently from 2430b67 to 2fc211e Compare March 9, 2025 03:11
@adrienpoly adrienpoly force-pushed the normalize-yml-files branch from e2a64ce to 393bac6 Compare March 19, 2025 07:15
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

Successfully merging this pull request may close these issues.

1 participant