Skip to content

yq add blank line in scalar block #1191

Open
@ademar59

Description

@ademar59

Describe the bug

a new blank line will ba added at the beginning of the the block

this bug will be important when using

yq e '.version = 4' test.yaml

but it will appears with

yq '.' test.yaml

Version of yq: 4.25.4
Operating system: debian
Installed via: git

Input Yaml

version: 3
scaler1: >-
  [
    "A",
    "B",
    "C"
  ]
scaler2: |-
  [
    "A",
    "B",
    "C"
  ]

Command
The command you ran:

yq '.' test.yaml

Actual behavior

version: 3
scaler1: >-
  [

    "A",
    "B",
    "C"
  ]
scaler2: |-
  [
    "A",
    "B",
    "C"
  ]

Expected behavior

version: 3
scaler1: >-
  [
    "A",
    "B",
    "C"
  ]
scaler2: |-
  [
    "A",
    "B",
    "C"
  ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions