Sources/Animation.swift
Line should not have any trailing whitespace Open
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••¬
Return arrow at column 47 should have exactly one space before it Open
Open
func performAnimations(completion: ((Bool)->Void)?)
- Read upRead up
- Exclude checks
arrow-whitespace
Prefer a single space before and after '->'.
Function and Closure declarations
Preferred
func onePlusTwo() -> Int {
return 1 + 2
}
names.map() {
(name) -> Int in
return 1
}
Not Preferred
func onePlusTwo()->Int {
return 1 + 2
}
names.map() {
(name) -> Int in
return 1
}
class SomeClass: SomeSuperClass{
}
Subscript declarations
Preferred
struct TimesTable {
let multiplier: Int
subscript(index: Int) -> Int {
return multiplier * index
}
}
Not Preferred
struct TimesTable {
let multiplier: Int
subscript(index: Int)-> Int {
return multiplier * index
}
}
struct SomeStruct : SomeParentStruct {
}
Function Types
Preferred
func something() -> (Int, Int) -> (Int) {
// do something
}
Not Preferred
func something() -> (Int, Int)-> (Int) {
// do something
}
func something() -> (Int, Int) -> (Int){
// do something
}
Return arrow at column 47 should have exactly one space after it Open
Open
func performAnimations(completion: ((Bool)->Void)?)
- Read upRead up
- Exclude checks
arrow-whitespace
Prefer a single space before and after '->'.
Function and Closure declarations
Preferred
func onePlusTwo() -> Int {
return 1 + 2
}
names.map() {
(name) -> Int in
return 1
}
Not Preferred
func onePlusTwo()->Int {
return 1 + 2
}
names.map() {
(name) -> Int in
return 1
}
class SomeClass: SomeSuperClass{
}
Subscript declarations
Preferred
struct TimesTable {
let multiplier: Int
subscript(index: Int) -> Int {
return multiplier * index
}
}
Not Preferred
struct TimesTable {
let multiplier: Int
subscript(index: Int)-> Int {
return multiplier * index
}
}
struct SomeStruct : SomeParentStruct {
}
Function Types
Preferred
func something() -> (Int, Int) -> (Int) {
// do something
}
Not Preferred
func something() -> (Int, Int)-> (Int) {
// do something
}
func something() -> (Int, Int) -> (Int){
// do something
}
Line should not have any trailing whitespace Open
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••¬