Skip to content

Commit

Permalink
load ktlint standard rule set manually
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentlauvlwj committed Aug 6, 2023
1 parent a9fdcf6 commit 2f27c68
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 2f27c68

Please sign in to comment.