Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brodybits
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

@brodybits brodybits 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.

brodybits added a commit to brodybits/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.

None yet

1 participant