-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optionally allow adding - returns:
docs to initializers
#557
Comments
I'm more than happy to submit a PR but I jus don't know how to check if the func delcarationReturns(declaration: String, kind: SwiftDeclarationKind? = nil) -> Bool {
if let kind = kind where SwiftDeclarationKind.variableKinds().contains(kind) {
return true
}
guard let outsideBracesMatch = matchOutsideBraces(declaration) else {
return false
}
return outsideBracesMatch.containsString("->")
} in To sum it up I felt pretty stupid trying to contribute to this repo. I couldn't find a way to extract function name from SourceKitten and .... (sigh) |
There's another thing it misses too: func myFunction(closure: (firstInt: Int, secondInt: Int) throws -> Void) {
} If a closure argument can throw an error, |
Dupe of #439? |
I have same issue. |
- returns:
docs to initializers
this is a good "starter bug" if anyone is interested in contributing to SwiftLint. |
@startupthekid
It seems like a separate issue. |
Fixed in #739. |
Hi,
I use VVDocumenter to help me document my codes.
init()
functions return an objects, although not explicitly defined in their syntax. For this particular reason, SwiftLint-ing them complains that their documentations are invalid.example:
(Disclaimer: This is just an example)
Swift lint will complain and say:
Although it is perfectly valid. You might argue that we don't need to document the return part, but I have many cases that it helps clarify the resulted instance, especially in case of failable initializers.
UPDATE:
Just to be clear, removing
- returns
from documentation does actually solve the validation problem.The text was updated successfully, but these errors were encountered: