diff --git a/ktlint-gradle-plugin/src/main/kotlin/io/github/usefulness/KtlintGradlePlugin.kt b/ktlint-gradle-plugin/src/main/kotlin/io/github/usefulness/KtlintGradlePlugin.kt index cea9644..afb8107 100644 --- a/ktlint-gradle-plugin/src/main/kotlin/io/github/usefulness/KtlintGradlePlugin.kt +++ b/ktlint-gradle-plugin/src/main/kotlin/io/github/usefulness/KtlintGradlePlugin.kt @@ -34,8 +34,8 @@ public class KtlintGradlePlugin : Plugin { val ktlintConfiguration = createKtlintConfiguration(pluginExtension) val ruleSetConfiguration = createRuleSetConfiguration(ktlintConfiguration) val reportersConfiguration = createReportersConfiguration(ktlintConfiguration) - val recognisedEditorConfigs = generateSequence(project) { it.parent } - .map { it.layout.projectDirectory.file(".editorconfig").asFile } + val recognisedEditorConfigs = generateSequence(projectDir) { if (it == rootProject.projectDir) null else it.parentFile } + .map { it.resolve(".editorconfig") } .toList() tasks.register("validateEditorConfigForKtlint", CheckEditorConfigTask::class.java) {