Skip to content

Formatting Breaking Null Values and Changing Quotations #1148

@joshwright10

Description

@joshwright10

Describe the bug

In the last couple of months, the YAML extension has been messing with my YAML files in an undesirable way.
It has decided to start changing all double quotes to single quotes and, in some files, it has been moving some null objects {} and [] onto the next line, which has broken my YAML files as can be seen in the screenshot.

I don't have any other formatter installed and am up-to-date with this extension and all others. yq is also up-to-date on v4.47.2.

Image

Expected Behavior

Formatting the document should not push YAML object values to the next line. They should be untouched.
Double quotes should be left alone.

Current Behavior

Some, not all, empty values are pushed to the next line, such as null, [] and {}.
I am also seeing that formatting the document changes quotes from double quotations to single quotations.

I have verified manually and using CoPilot that my VS Code settings aren't causing this, especially the quotation changes.

Steps to Reproduce

  1. redhat.vscode-yaml, 1.18.0
  2. yq v4.47.2

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions