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

Related issues

tomasebrennan picture tomasebrennan  路  3Comments

jcarroll-mediafly picture jcarroll-mediafly  路  3Comments

ziryanov picture ziryanov  路  3Comments

Den-Ree picture Den-Ree  路  3Comments

Tableau-David-Potter picture Tableau-David-Potter  路  3Comments