Closed klei1984 closed 4 years ago
I tried out the formatting and had some odd result as you...
The problem is, that under the hood snake-yaml parser is used to load the yaml document from string content into a yaml object and after this the object is dumped back to a string.
So we got String -> Yaml-Object ->String
"on" is recognized by snake-yaml as a boolean value... so inside the loaded yaml object its recognized as "boolean:true" and when doing the dump the output is switched to "true".
I have looked into the sources and found a potential solution: snake-yaml gives many possibilities to use specialized renderers and resolvers. Maybe for formatting there should customized variants which could avoid the problem.
Just released V1.6.2 on eclipse marketplace
Formatter preference page has got a new option "prevent type conversion" which is enabled per default:
When this is enabled, your example is formatted like next screenshots: becomes:
Thanks a lot!
I am setting up a github actions script which is in yaml format. Actions has a specific keyword set which relies on
<key>: <value>
syntax. See this page for all the keywords.The on.push.branches event is basically described with the below yaml code:
I am using version 1.6.1 of the editor which converts the
on:
key to the booleantrue
value as in the below result:I did not check what github actions actually do with such a script, but my assumption is that keys are not supposed to be replaced by boolean values.
Am I missing something? I found a similar issue here but that is another tool and another context.
Or could it be that the yaml format used by Github is not actually compliant to either version of the standard and thus I should not try to use a yaml editor for such scripts?