Literal Expression End Indentation

Array and dictionary literal end should have the same indentation as the line that started it

  • Identifier: literal_expression_end_indentation
  • Enabled by default: No
  • Supports autocorrection: Yes
  • Kind: style
  • Analyzer rule: No
  • Minimum Swift compiler version: 5.0.0
  • Default configuration:
    KeyValue
    severity warning

Non Triggering Examples

[1, 2, 3]
[1,
 2
]
[
   1,
   2
]
[
   1,
   2]
   let x = [
       1,
       2
   ]
[key: 2, key2: 3]
[key: 1,
 key2: 2
]
[
   key: 0,
   key2: 20
]

Triggering Examples

let x = [
   1,
   2
   ]
   let x = [
       1,
       2
]
let x = [
   key: value
   ]