You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The yamlfmt program does not evaluate the frontmatter correctly when already present in the yaml file and the formatter configuration specifies include_document_start with true.
The problem is evident when there are particular comments such as the vim modelines before the frontmatter, if the latter is moved to line 1 the modeline is not evaluated correctly by the editors.
Steps to play
Create a .yamlfmt configuration file and set the include_document_start option to true in the section formatter;
Create a yaml file with a modeline on line 1, the front matter on line 2 and arbitrary content starting from line 3.
Run yamlfmt on the created yaml file.
Expected behavior
If the front matter is already present in the file and preceded by comments, it should not be moved to the first line of the file.
If it is not present you should insert it after modelines or after all the initial comments before the first valid yaml line.
This looks similar to #74. Similar to the other issues with the underlying yaml library, I'm not sure if I will be able to get to it anytime soon unfortunately.
Description
The yamlfmt program does not evaluate the frontmatter correctly when already present in the yaml file and the formatter configuration specifies include_document_start with true.
The problem is evident when there are particular comments such as the vim modelines before the frontmatter, if the latter is moved to line 1 the modeline is not evaluated correctly by the editors.
Steps to play
Expected behavior
If the front matter is already present in the file and preceded by comments, it should not be moved to the first line of the file.
If it is not present you should insert it after modelines or after all the initial comments before the first valid yaml line.
Scripts
Environment details
The text was updated successfully, but these errors were encountered: