woshiccm / Pecker

CodePecker is a tool to detect unused Swift code.
MIT License
1.46k stars 63 forks source link

False positive: `skip_public` does not apply to interfaces in public extension scope #57

Open tackgyu opened 4 years ago

tackgyu commented 4 years ago

With skip_public rule enabled (which already is by default),

This case is detected as unused.

public extension NSParagraphStyle {
    static var level1: NSParagraphStyle { ... }
}

This one is not.

extension NSParagraphStyle {
    public static var level1: NSParagraphStyle { ... }
}
antoinepemeja commented 3 years ago

Hello,

I confirm this issue.

In this case bar() is detected as unused :

extension Foo { static func bar() { } }

In this case bar() is not detected as unused :

extension Foo { public static func bar() { } }