From fb33b9d46e486a35bd5af98ebcce950014fffb06 Mon Sep 17 00:00:00 2001 From: Manuel Martos Date: Mon, 3 Oct 2022 16:39:13 +0200 Subject: [PATCH] Fix issue that prevents accessing right configuration data (#94) --- .../kotlin/com/twitter/rules/core/detekt/TwitterDetektRule.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-detekt/src/main/kotlin/com/twitter/rules/core/detekt/TwitterDetektRule.kt b/core-detekt/src/main/kotlin/com/twitter/rules/core/detekt/TwitterDetektRule.kt index 6c6a7c3a..e750f8ae 100644 --- a/core-detekt/src/main/kotlin/com/twitter/rules/core/detekt/TwitterDetektRule.kt +++ b/core-detekt/src/main/kotlin/com/twitter/rules/core/detekt/TwitterDetektRule.kt @@ -26,7 +26,7 @@ abstract class TwitterDetektRule( config: Config = Config.empty ) : Rule(config), ComposeKtVisitor { - private val config: ComposeKtConfig = DetektComposeKtConfig(config) + private val config: ComposeKtConfig by lazy { DetektComposeKtConfig(this) } private val emitter: Emitter = Emitter { element, message, canBeAutoCorrected -> // Grab the named element if there were any, otherwise fall back to the whole PsiElement