geofffranks / spruce

A BOSH template merge tool
MIT License
427 stars 77 forks source link

Multiline reformatted during merge #313

Closed stevewallone closed 2 years ago

stevewallone commented 4 years ago

During a merge, a multiline element is reformatted as a string with newline characters '\n'. Below is a snippet of the before and after. I'm wondering if there is a way to avoid this reformatting.

 JCasC:
     enabled: true
     configScripts:
       base: |
         jenkins:
           agentProtocols:
             - "JNLP4-connect"
             - "Ping"

JCasC:
     configScripts:
       base: "jenkins:\n  agentProtocols:\n    - \"JNLP4-connect\"\n    - \"Ping\"
HeavyWombat commented 4 years ago

Just as an observation, the new Go YAML library version 3 stores the flow style now. This could help with scenarios like the one mentioned here to keep the style when marshaling the result YAML.

geofffranks commented 2 years ago

closing as stale