Line should not have any trailing whitespace Open
- Read upRead up
- Exclude checks
trailing-whitespace
Flag whitespace after the last non-whitespace character on each line until the newline.
Preferred
let number = 42¬
Not Preferred
let number = 42••¬
Line should not have any trailing whitespace Open
- Read upRead up
- Exclude checks
trailing-whitespace
Flag whitespace after the last non-whitespace character on each line until the newline.
Preferred
let number = 42¬
Not Preferred
let number = 42••¬
Line should not have any trailing whitespace Open
- Read upRead up
- Exclude checks
trailing-whitespace
Flag whitespace after the last non-whitespace character on each line until the newline.
Preferred
let number = 42¬
Not Preferred
let number = 42••¬
Line should not have any trailing whitespace Open
- Read upRead up
- Exclude checks
trailing-whitespace
Flag whitespace after the last non-whitespace character on each line until the newline.
Preferred
let number = 42¬
Not Preferred
let number = 42••¬
Line should not have any trailing whitespace Open
- Read upRead up
- Exclude checks
trailing-whitespace
Flag whitespace after the last non-whitespace character on each line until the newline.
Preferred
let number = 42¬
Not Preferred
let number = 42••¬
Variable names should be lowerCamelCase Open
private var _cancelled = false
- Read upRead up
- Exclude checks
lower-camel-case
method
and var
names should follow lowerCamelCase naming convention: first letter of the entire word is lowercase, but subsequent first letters are uppercase.
Method and selector names
Preferred
func someMethod() {
// method definition goes here
}
Not Preferred
func some-method() {
// method definition goes here
}
Variable names
Preferred
var someVariable = someValue
Not Preferred
var Some_Var1able = someValue
Line should not have any trailing whitespace Open
- Read upRead up
- Exclude checks
trailing-whitespace
Flag whitespace after the last non-whitespace character on each line until the newline.
Preferred
let number = 42¬
Not Preferred
let number = 42••¬
Line should not have any trailing whitespace Open
- Read upRead up
- Exclude checks
trailing-whitespace
Flag whitespace after the last non-whitespace character on each line until the newline.
Preferred
let number = 42¬
Not Preferred
let number = 42••¬
Operator definitions should be followed by exactly one space Open
func +=<MultiRequestResult, RequestType: Request>(lhs: MultiRequest<MultiRequestResult>, rhs: RequestType) {
- Read upRead up
- Exclude checks
angle-bracket-whitespace
There should be no whitespace immediately before/after an opening chevron <
and before the closing chevron >
.
Generics
Preferred
func simpleMax<t: comparable>(x: T, _ y: T) -> T {
if x < y {
return y
}
return x
}</t:>
Not Preferred
func simpleMax < T: Comparable >(x: T, _ y: T) -> T {
if x < y {
return y
}
return x
}
Requirement list
Preferred
func allItemsMatch<
C1: Container, C2: Container
where C1.ItemType == C2.ItemType, C1.ItemType: Equatable>
(someContainer: C1, _ anotherContainer: C2) -> Bool {}
Not Preferred
func allItemsMatch <
C1: Container, C2: Container
where C1.ItemType == C2.ItemType, C1.ItemType: Equatable >
(someContainer: C1, _ anotherContainer: C2) -> Bool {}
Line should not have any trailing whitespace Open
- Read upRead up
- Exclude checks
trailing-whitespace
Flag whitespace after the last non-whitespace character on each line until the newline.
Preferred
let number = 42¬
Not Preferred
let number = 42••¬
Line should not have any trailing whitespace Open
- Read upRead up
- Exclude checks
trailing-whitespace
Flag whitespace after the last non-whitespace character on each line until the newline.
Preferred
let number = 42¬
Not Preferred
let number = 42••¬