Speed up class_delegate_protocol rule (#4743)

This commit is contained in:
Marcelo Fabri 2023-02-05 18:45:24 -08:00 committed by GitHub
parent 993f34a96c
commit aba0f63704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,10 @@ struct ClassDelegateProtocolRule: SwiftSyntaxRule, ConfigurationProviderRule {
private extension ClassDelegateProtocolRule {
private final class Visitor: ViolationsSyntaxVisitor {
override var skippableDeclarations: [DeclSyntaxProtocol.Type] {
.allExcept(ProtocolDeclSyntax.self)
}
override func visitPost(_ node: ProtocolDeclSyntax) {
if node.identifier.text.hasSuffix("Delegate") &&
!node.hasObjCAttribute() &&