Skip to content

add inner spacing to inline objects (non-empty) - BREAKING#68

Open
brody2consult wants to merge 1 commit intopappasam:mainfrom
brody2consult:inner-inline-object-spacing
Open

add inner spacing to inline objects (non-empty) - BREAKING#68
brody2consult wants to merge 1 commit intopappasam:mainfrom
brody2consult:inner-inline-object-spacing

Conversation

@brody2consult
Copy link

I think this would be much cleaner. I would be happy to make this optional (my time permitting), if needed.

example from tests/examples/sorted/inline-default.toml:

'aalist' = { c = "test", a = "another test" } # list comment

multi-line example from tests/examples/sorted/inline-default.toml:

[a]
test = [
  { x = [
      "foo",
      "bar"
    ], a = [
      ""
    ] },
  { y = [
      "foo",
      "baz"
    ] }
]

NOTE that I would personally care the most about the single-line object case, no need for multi-line object formatting in my work at this point.

Copy link
Author

@brody2consult brody2consult left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the multi-line object formatting could use some improvement:

  • closing curly-brace should be out-dented on the next line
  • should start a new line after the opening curly-brace
  • should be able to add trailing comma after closing curly-brace, in a similar style to using --trailing-comma-inline-array with inline arrays, for multi-line case only

But this is not a high-priority for me, single-line object formatting with the proposed inner spacing is what I care about at this point.

Thanks in advance for the consideration.

brody2consult pushed a commit to brody2consult/pretty-toml-sort that referenced this pull request Jan 7, 2024
includes pappasam/toml-sort#68 - add inner spacing to inline objects
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.

1 participant