Skip to content

feat: jsonnetfmt remove newlines after ObjectField id#780

Open
DinoChiesa wants to merge 1 commit intogoogle:masterfrom
DinoChiesa:master
Open

feat: jsonnetfmt remove newlines after ObjectField id#780
DinoChiesa wants to merge 1 commit intogoogle:masterfrom
DinoChiesa:master

Conversation

@DinoChiesa
Copy link

add handling of ObjectField in fix_newlines.go

With this input:

local c =
  import "json2xml.libjsonnet";

local d = {
  name:

    "foo",

  children:
 ["bar", "bam"],
};

{
  output:
  c.manifestXml(d, "elements"),
}

BEFORE this change:

local c =
  import 'json2xml.libjsonnet';

local d = {
  name:

    'foo',

  children:
    ['bar', 'bam'],
};

{
  output:
    c.manifestXml(d, 'elements'),
}

WITH this change:

local c =
  import 'json2xml.libjsonnet';

local d = {
  name: 'foo',

  children: ['bar', 'bam'],
};

{
  output: c.manifestXml(d, 'elements'),
}

@rudo-thomas
Copy link
Contributor

FWIW, I think the formatter works as I would expect already and it is consistent: it doesn't remove newlines in the syntax described in this PR, neither in other constructs – local variables after the =, after function parameters, ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants