diff --git a/Source/SwiftLintCoreMacros/RuleConfigurationMacros.swift b/Source/SwiftLintCoreMacros/RuleConfigurationMacros.swift index 92da708016..7767063454 100644 --- a/Source/SwiftLintCoreMacros/RuleConfigurationMacros.swift +++ b/Source/SwiftLintCoreMacros/RuleConfigurationMacros.swift @@ -1,5 +1,6 @@ import Foundation import SwiftSyntax +import SwiftSyntaxBuilder import SwiftSyntaxMacros enum AutoApply: MemberMacro { @@ -34,41 +35,46 @@ enum AutoApply: MemberMacro { let elementNames = annotatedVarDecls.compactMap { $0.0.bindings.first?.pattern.as(IdentifierPatternSyntax.self)?.identifier.text } - let inlinedOptionsUpdate = elementNames[firstIndexWithoutKey...].map { - """ - do { - try \($0).apply(configuration, ruleID: Parent.identifier) - try $\($0).performAfterParseOperations() - } catch let issue as Issue where issue == Issue.nothingApplied(ruleID: Parent.identifier) { - // Acceptable. Continue. - } - """ - } - let nonInlinedOptionsUpdate = elementNames[..