Skip to content

Files

Latest commit

 

History

History
40 lines (19 loc) · 614 Bytes

operator_whitespace.md

File metadata and controls

40 lines (19 loc) · 614 Bytes

Pattern: Malformed whitespace around func

Issue: -

Description

Operators should be surrounded by a single whitespace when defining them.

Examples of correct code:

func <| (lhs: Int, rhs: Int) -> Int {}


func <|< <A>(lhs: A, rhs: A) -> A {}


func abc(lhs: Int, rhs: Int) -> Int {}

Examples of incorrect code:

func <|(lhs: Int, rhs: Int) -> Int {}


func <|<<A>(lhs: A, rhs: A) -> A {}


func <|  (lhs: Int, rhs: Int) -> Int {}


func <|<  <A>(lhs: A, rhs: A) -> A {}


func  <| (lhs: Int, rhs: Int) -> Int {}


func  <|< <A>(lhs: A, rhs: A) -> A {}