Swiftlint: `statement_position` rule customization

Created on 13 Jan 2017  路  2Comments  路  Source: realm/SwiftLint

I want to change rule only for else, moving else to next line, for example:

if true {

}
else {

}

Can I do it with configuration file?

question

Most helpful comment

@artemnovichkov Try use the uncuddled_else configuration option.

So use the following in your .swiftlint.yml:

statement_position:
  statement_mode: uncuddled_else

See: https://github.com/realm/SwiftLint/blob/5f442adf5b7725ac2553668f7db925622c821094/Source/SwiftLintFramework/Rules/StatementPositionRule.swift#L45-L72

All 2 comments

@artemnovichkov Try use the uncuddled_else configuration option.

So use the following in your .swiftlint.yml:

statement_position:
  statement_mode: uncuddled_else

See: https://github.com/realm/SwiftLint/blob/5f442adf5b7725ac2553668f7db925622c821094/Source/SwiftLintFramework/Rules/StatementPositionRule.swift#L45-L72

It works, thanks, @aamctustwo!

Was this page helpful?
0 / 5 - 0 ratings