From 4bc12a26b5ff7eac5c5d642e5af08b64a2923807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Wed, 17 Jul 2024 23:12:50 +0200 Subject: [PATCH] Fix isolated projects compatibility --- .../main/kotlin/io/github/usefulness/KtlintGradlePlugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) {