Skip to content

Question about pathological indentation inside object #839

Open
@tminor

Description

@tminor

I'm currently reimplementing jsonnet-mode's indentation function in an effort to follow jsonnetfmt's output as closely as possible. I'm curious if the following indentation is considered correct:

{
  id: 1 +
      2 + (
    if true then
      0
    else
      3
  ),
}

This seems more natural to me (and it's what the new indentation function yields):

{
  id: 1 +
      2 + (
        if true then
          0
        else
          3
      ),
}

On a side note, jsonnet-mode's previous maintainer recently transferred ownership to me but https://jsonnet.org/learning/tools.html points to the old location. It redirects correctly, so it probably doesn't really matter!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions