From 2f27c68bf328dde9109038aa73a843dec5ad94e7 Mon Sep 17 00:00:00 2001 From: vince Date: Sun, 6 Aug 2023 16:59:20 +0800 Subject: [PATCH] load ktlint standard rule set manually --- .../kotlin/org/ktorm/ksp/compiler/KtormProcessorProvider.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/KtormProcessorProvider.kt b/ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/KtormProcessorProvider.kt index 5b2c5f98..6095f0ea 100644 --- a/ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/KtormProcessorProvider.kt +++ b/ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/KtormProcessorProvider.kt @@ -21,8 +21,8 @@ import com.google.devtools.ksp.symbol.KSAnnotated import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFile import com.pinterest.ktlint.core.KtLintRuleEngine -import com.pinterest.ktlint.core.RuleSetProviderV2 import com.pinterest.ktlint.core.api.EditorConfigDefaults +import com.pinterest.ktlint.ruleset.standard.StandardRuleSetProvider import com.squareup.kotlinpoet.FileSpec import org.ec4j.core.EditorConfigLoader import org.ec4j.core.Resource.Resources @@ -39,7 +39,8 @@ import kotlin.reflect.jvm.jvmName */ public class KtormProcessorProvider : SymbolProcessorProvider { private val ktLintRuleEngine = KtLintRuleEngine( - ruleProviders = ServiceLoader.load(RuleSetProviderV2::class.java).flatMap { it.getRuleProviders() }.toSet(), + // ruleProviders = ServiceLoader.load(RuleSetProviderV2::class.java).flatMap { it.getRuleProviders() }.toSet(), + ruleProviders = StandardRuleSetProvider().getRuleProviders(), editorConfigDefaults = EditorConfigDefaults( EditorConfigLoader.default_().load( Resources.ofClassPath(javaClass.classLoader, "/ktorm-ksp-compiler/.editorconfig", Charsets.UTF_8)