File tree Expand file tree Collapse file tree
plugin-gradle/src/main/java/com/diffplug/gradle/spotless Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525
2626import javax .annotation .Nullable ;
2727
28+ import org .gradle .api .file .Directory ;
29+
2830import com .diffplug .common .collect .ImmutableList ;
2931import com .diffplug .common .collect .ImmutableSortedMap ;
3032import com .diffplug .spotless .FileSignature ;
@@ -160,7 +162,9 @@ private KtlintConfig(
160162 Map <String , Object > editorConfigOverride ,
161163 List <String > customRuleSets ) throws IOException {
162164 Objects .requireNonNull (version );
163- File defaultEditorConfig = new File (getProject ().getRootDir (), ".editorconfig" );
165+ @ SuppressWarnings ("UnstableApiUsage" )
166+ Directory rootProjectDir = getProject ().getIsolated ().getRootProject ().getProjectDirectory ();
167+ File defaultEditorConfig = rootProjectDir .file (".editorconfig" ).getAsFile ();
164168 FileSignature editorConfigPath = defaultEditorConfig .exists () ? FileSignature .signAsList (defaultEditorConfig ) : null ;
165169 this .version = version ;
166170 this .editorConfigPath = editorConfigPath ;
You can’t perform that action at this time.
0 commit comments