-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
closure_spacing should ignore empty bodies #875
Comments
I can't think of a single real-world use-case where this would be the case. Please correct me if I'm missing something obvious. Your current example doesn't follow convention as typically you'd write: |
Well it's not so much about the init, but about the spacing between the brackets. However, when mocking classes for testing, it often happens that you have to implement a method without a body. Using It's a super big deal, but figured I'd open an issue anyway so it can be reviewed. |
Another common case is to make existing types conform to a protocol, for example: protocol ReusableView: class {
static var reuseIdentifier: String { get }
}
extension ReusableView where Self: UIView {
static var reuseIdentifier: String {
return String(describing: self)
}
}
extension UITableViewCell: ReusableView { } |
Triggering example:
The expectation would be that empty bodies with a single space does not trigger a warning.
The text was updated successfully, but these errors were encountered: