Returning Whitespace

Return arrow and return type should be separated by a single space or on a separate line.

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

Non Triggering Examples

func abc() -> Int {}

func abc() -> [Int] {}

func abc() -> (Int, Int) {}

var abc = {(param: Int) -> Void in }

func abc() ->
    Int {}

func abc()
    -> Int {}

typealias SuccessBlock = ((Data) -> Void)

Triggering Examples

func abc()->Int {}

func abc()->[Int] {}

func abc()->(Int, Int) {}

func abc()-> Int {}

func abc() ->Int {}

func abc()  ->  Int {}

var abc = {(param: Int) ->Bool in }

var abc = {(param: Int)->Bool in }

typealias SuccessBlock = ((Data)->Void)