From aba0f63704a666317c2456f7be93aa90d2f14113 Mon Sep 17 00:00:00 2001 From: Marcelo Fabri Date: Sun, 5 Feb 2023 18:45:24 -0800 Subject: [PATCH] Speed up class_delegate_protocol rule (#4743) --- .../Rules/Lint/ClassDelegateProtocolRule.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/SwiftLintFramework/Rules/Lint/ClassDelegateProtocolRule.swift b/Source/SwiftLintFramework/Rules/Lint/ClassDelegateProtocolRule.swift index 906aa1ecb..02b5dc2cd 100644 --- a/Source/SwiftLintFramework/Rules/Lint/ClassDelegateProtocolRule.swift +++ b/Source/SwiftLintFramework/Rules/Lint/ClassDelegateProtocolRule.swift @@ -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() &&