Skip to content

Sorting keys with ICU Message adds empty line #2452

@cierzniak

Description

@cierzniak

Describe the bug

I read the docs of Symfony about plural translations https://symfony.com/doc/current/reference/formats/message_format.html and created file with my message. Also created script for my CI/CD pipeline to run yq sort_lines(..) $file on every file in translations directory. I spotted an issue about adding random blank line on every app run so pipeline always fails

Version of yq: 4.47.1
Operating system: mac
Installed via: homebrew

Input Yaml

messages+intl-icu.en.yaml:

common:
  age_year: >-
    {count, plural,
      one {# year}
      other {# years}
    }

Command
The command you ran:

yq eval 'sort_keys(..)'messages+intl-icu.en.yaml

Actual behavior

common:
  age_year: >-
    {count, plural,

      one {# year}
      other {# years}
    }

Expected behavior

common:
  age_year: >-
    {count, plural,
      one {# year}
      other {# years}
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions