Skip to content

Bad indentation of hash with symbol-array literal values #427

Description

@owst

Using e367f7b the following code is misindented:

x_to_y_mapping = {
  'x_one' => %i[
    y_one
    y_two
  ],
  'x_two' => %i[
    y_three
    y_four
  ]
}

becomes:

x_to_y_mapping = {
  'x_one' => %i[
  y_one
  y_two
  ],
    'x_two' => %i[
  y_three
  y_four
  ]
}

the issues as I see it being:

  1. The symbol-array literal elements are dedented to align with the hash key
  2. The second key is indented relative to the first key

N.b. the following is correctly indented:

x_to_y_mapping = {
  'x_one'=> [
    :y_one,
    :y_two
  ],
  'x_two' => [
    :y_three,
    :y_four
  ]
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions