-
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
Rule Request: prefer 'joined()' over 'joined(separator: "")' #1093
Comments
since that's the default separator. Rule for this requested in #1093.
Does SourceKitten provide sufficient detail to make this rule more general? In other words, detect any instance where a function is being used with its default arguments. |
I don't think so, we'd have to keep a list with known functions and default parameters. |
No, it doesn't, because binary Swift modules don't actually contain that information 😱 For example, looking at the generated interface for the Swift standard library in Xcode itself, you get this: extension Array where Element == String {
public func joined(separator: String = default) -> String
} Notice the I actually think (I could be wrong) that this has something to do with Swift's planned ABI stability. But I'm not sure. |
to discourage explicit use of default separator. Implements realm#1093.
to discourage explicit usage of the default separator. Implements realm#1093.
to discourage explicit usage of the default separator. Implements realm#1093.
to discourage explicit usage of the default separator. Implements realm#1093.
Closed by @ornithocoder in #1746 🎉 |
to discourage explicit usage of the default separator. Implements #1093.
since that's the default separator.
The text was updated successfully, but these errors were encountered: