Skip to content
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

False positive missing_docs with Swift 2.3 #855

Closed
ghost opened this issue Oct 24, 2016 · 6 comments
Closed

False positive missing_docs with Swift 2.3 #855

ghost opened this issue Oct 24, 2016 · 6 comments

Comments

@ghost
Copy link

ghost commented Oct 24, 2016

MacBook-Pro:Example loyolny$ swiftlint version
0.12.0

I'm using Xcode 8 with Swift 2.3. Here's the class:

import UIKit

/// Just a sample class
public class SampleClass {

    /**
     Example method

     - returns: Bool (true)
     */
    func exampleMethod() -> Bool {
        // Returns true to satisfy example unit test
        return true
    }

    /**
     Example method

     - returns: Bool (true)
     */
    func exampleMethod2() -> Bool {
        // Returns true to satisfy example unit test
        return true
    }
}

When I build the project in Xcode, it passes swxftlint phase without any warnings (other warnings appear, it's just missing_docs problem)

When I run swiftlint in console, that's what I get: /Users/[...]/Pod/Classes/SampleClass.swift:12:8: warning: Missing Docs Violation: Public declarations should be documented. (missing_docs)

So I guess console gives me false positive missing_docs, because the class and functions are described.

@tapi
Copy link

tapi commented Oct 28, 2016

We're seeing similar behaviour except its public properties

// An object describing a round within a bracket
public class Round {
    /// true if the round is the final round within the bracket, false otherwise.
    public var finals: Bool = false
}

For us it looks as though the difference between Xcode and command line is probably because we have swiftlint running in the main app targets build phase but the model is part of another target.

Either way the class and properties are documented and swiftlint is reporting failures

@ghost
Copy link
Author

ghost commented Oct 31, 2016

Well, I had to stop using this rule, because it's made my builds on Bamboo fail :/

@nhgrif
Copy link

nhgrif commented Nov 7, 2016

The title of this issue says Swift 2.3, but the original comment says Swift 3.0. Is it happening for both?

@tapi
Copy link

tapi commented Nov 7, 2016

We are seeing the issue with Swift 2.3, can't speak to wether or not it affects 3.0

@ghost
Copy link
Author

ghost commented Nov 8, 2016

@nhgrif Oh, man. It was a mistake. It's Swift 2.3

@jpsim
Copy link
Collaborator

jpsim commented Nov 25, 2016

This is a duplicate of #728. Please see my comment there (#728 (comment)) for more details and suggestions on how to resolve the situation. Thanks!

@jpsim jpsim closed this as completed Nov 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants