-
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
Add UnusedDeclarationRule #2814
Conversation
Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amazing!
|
||
// Classes marked as @UIApplicationMain are used by the operating system as the entry point into the app. | ||
if let annotatedDecl = cursorInfo["key.annotated_decl"] as? String, | ||
annotatedDecl.contains("@UIApplicationMain") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add @objcMembers
in this same spot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. You could still have unused @objcMembers
classes though.
I'm inclined to still treat those as violations until someone requests otherwise.
6381063
to
69bc07b
Compare
Which was causing tests to fail on Swift 4.x
e2ec411
to
9a4a8c7
Compare
This PR adds a new
unused_declaration
analyzer rule to lint for unused declarations.By default, detects unused
fileprivate
,private
andinternal
declarations.Configure the rule with
include_public_and_open: true
to also detect unusedpublic
andopen
declarations.Completely remove the
unused_private_declaration
rule.This is built on the work enabling collecting rule infrastructure in #2714.