hammam abdulaziz
hammam abdulaziz

Reputation: 43

SwiftLint configuration rule

I don't like the default formate of the indentation for switch cases in Xcode and I prefer to make the formatting by 4 spaces 'tab' for switch cases so I read in documentation of switch_case_alignment rule and found that I can change the configuration for switch_case_alignment rule so I added this code

switch_case_alignment:
  - indented_cases: true

to the .swiftlint.yaml file but it doesn't work with me is there any other solution

for more clarification here is the code I need it to be without warning from swiftlint

switch test{
    case first: break
    case sec: break
}

Upvotes: 2

Views: 1583

Answers (1)

Joakim Danielson
Joakim Danielson

Reputation: 51872

Your configuration has a bad syntax, there should be no prefix dash (-) when configuring rules.

Your configuration should be

switch_case_alignment:  
  indented_cases: true

Upvotes: 3

Related Questions