Roberto Leinardi
03/21/2023, 12:20 PM.editorconfig should be used to format a Code.CodeSnippet with ktLintRuleEngine.format()?
I'm creating the ruleset like this:
private val ruleProviders = buildSet {
ServiceLoader.load(RuleSetProviderV2::class.java).flatMapTo(this) { it.getRuleProviders() }
}
private val ktLintRuleEngine = KtLintRuleEngine(ruleProviders = ruleProviders)
but I'm not sure if this will load the root .editorconfig from my project or just use some default ruleset.Roberto Leinardi
03/21/2023, 12:44 PMprivate val ktLintRuleEngine = KtLintRuleEngine(
ruleProviders = ruleProviders,
editorConfigDefaults = EditorConfigDefaults.load(
File(System.getProperty("user.dir")).parentFile.resolve(".editorconfig").toPath(),
),
)Roberto Leinardi
03/21/2023, 12:56 PMeditorConfigDefaults it's used also for CodeSnippet?Roberto Leinardi
03/21/2023, 3:09 PMPaul Dingemans
03/21/2023, 5:38 PMPaul Dingemans
03/22/2023, 7:57 PMRoberto Leinardi
03/22/2023, 8:14 PMRoberto Leinardi
03/23/2023, 11:06 AM