-
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
valid_doc false negative #758
Comments
check parameter name for exceptView (it is exceptSubview in your method) |
@Yaro812 Thanks a lot, my bad! However, this one shows the warning as well:
|
Just tested it and not getting a documentation error on it.
|
You are using the completion handler. There might be a slight bug in Swiftlint that shows documentation warning when closure that returns no value is written like (param: Int) -> (). You can rewrite it to be (param: Int) -> Void |
@freak4pc Interesting. Can you please try this one:
I'm getting a warning with this. By the way, my completion handlers look like this:
If the above piece compiles fine for you, may be I should update my SwiftLint? The current version is 0.10.0. |
I'm a bit busy atm will check later but you should definitely update. Current is 0.11.1 afaik. |
@freak4pc Thanks. |
@andrew8712 Did you try |
@freak4pc No, sorry. Updated fine now, however, getting the same warning with swiftlint 0.11.1 |
@freak4pc I found the problem. My func's description starts with Since my func has completion handlers, I believe the documentation may contain "Returns" keyword. So this condition is not the best fit:
Any ideas how to handle a case with completion handlers? |
If you want to bypass SwiftLint's semantics for determining whether or not a function returns, disable the rule. |
You description starts with a Edit: Oh sorry, just noticed that second part of the condition. @jpsim Is there any reason why this couldn't be omitted? If a method returns and doesn't include a |
A description starting with I don't think blocks/closures that are invoked with parameters count as "returning" in the same sense, and therefore shouldn't use either approach. |
Closing this since we removed this rule. |
@marcelofabri Mind linking to discussion on that? |
This rule wasn't working at all since Swift 2.3. At some point we disabled it on Swift 2.3+ and on the next release we'll drop support for Swift 2, so the rule was removed. |
Gotya. Thanks for the clarification 👍 |
The issue was that SourceKit stopped providing the information we need to make it work. Check #728 for more info. |
The function below returns warning:
Valid Docs Violation: Documented declarations should be valid. (valid_docs)
Is there any way to check what exactly causes this warning?
The text was updated successfully, but these errors were encountered: