Vertical Whitespace after Opening Braces
Don’t include vertical whitespace (empty line) after opening braces
- Identifier:
vertical_whitespace_opening_braces
- Enabled by default: No
- Supports autocorrection: Yes
- Kind: style
- Analyzer rule: No
- Minimum Swift compiler version: 5.0.0
- Default configuration:
Key Value severity warning
Non Triggering Examples
/*
class X {
let x = 5
}
*/
// [1, 2].map { $0 }.filter { num in true }
KingfisherManager.shared.retrieveImage(with: url, options: nil, progressBlock: nil) { image, _, _, _ in
guard let img = image else { return }
}
[
1,
2,
3
]
[1, 2].map { $0 }.filter { num in true }
[1, 2].map { $0 }.foo()
class X {
struct Y {
class Z {
}
}
}
foo(
x: 5,
y:6
)
foo({ }) { _ in
self.dismiss(animated: false, completion: {
})
}
func foo() {
run(5) { x in
print(x)
}
}
if x == 5 {
print("x is 5")
}
if x == 5 {
print("x is 5")
}
struct MyStruct {
let x = 5
}
Triggering Examples
KingfisherManager.shared.retrieveImage(with: url, options: nil, progressBlock: nil) { image, _, _, _ in
↓
guard let img = image else { return }
}
[
↓
1,
2,
3
]
class X {
struct Y {
↓
class Z {
}
}
}
foo(
↓
x: 5,
y:6
)
foo({ }) { _ in
↓
self.dismiss(animated: false, completion: {
})
}
func foo() {
↓
run(5) { x in
print(x)
}
}
if x == 5 {
↓
print("x is 5")
}
if x == 5 {
↓
print("x is 5")
}
struct MyStruct {
↓
let x = 5
}