Skip to content

Commit

Permalink
Remove @IBOutlet and @IBInspectable from UnusedDeclarationRule
Browse files Browse the repository at this point in the history
This list was intended to be things that could have side effects from
being in IB, or just being dynamic, and therefore we cannot tell if they
are used or not. In the case of the 2 attributes I'm removing, they
could be used in IB, but if they aren't used in code, they should still
be considered dead.
  • Loading branch information
keith committed Apr 23, 2020
1 parent 889dc49 commit 0056cdd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private extension SwiftLintFile {
// Skip declarations marked as @IBOutlet, @IBAction or @objc
// since those might not be referenced in code, but only dynamically (e.g. Interface Builder)
if let annotatedDecl = cursorInfo.annotatedDeclaration,
["@IBOutlet", "@IBAction", "@objc", "@IBInspectable"].contains(where: annotatedDecl.contains) {
["@IBAction", "@objc"].contains(where: annotatedDecl.contains) {
return nil
}

Expand Down

0 comments on commit 0056cdd

Please sign in to comment.