Indentation Width

Indent code using either one tab or the configured amount of spaces, unindent to match previous indentations. Don’t indent the first line.

  • Identifier: indentation_width
  • Enabled by default: No
  • Supports autocorrection: No
  • Kind: style
  • Analyzer rule: No
  • Minimum Swift compiler version: 5.0.0
  • Default configuration:
    KeyValue
    severity warning
    indentation_width 4
    include_comments true
    include_compiler_directives true
    include_multiline_strings true

Non Triggering Examples

firstLine
secondLine
firstLine
    secondLine
firstLine
    secondLine
        thirdLine

        fourthLine
firstLine
    secondLine
        thirdLine
    //test
        fourthLine
firstLine
    secondLine
        thirdLine
fourthLine

Triggering Examples

    firstLine
firstLine
        secondLine
firstLine
    secondLine

         fourthLine
firstLine
    secondLine
        thirdLine
 fourthLine