File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
plugin-maven/src/main/java/com/diffplug/spotless/maven/kotlin Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 3131import com .diffplug .spotless .maven .FormatterStepFactory ;
3232
3333public class Ktlint implements FormatterStepFactory {
34+ private static final File defaultEditorConfig = new File (".editorconfig" );
35+
3436 @ Parameter
3537 private String version ;
3638 @ Parameter
@@ -44,11 +46,8 @@ public class Ktlint implements FormatterStepFactory {
4446 public FormatterStep newFormatterStep (final FormatterStepConfig stepConfig ) {
4547 String ktlintVersion = version != null ? version : KtLintStep .defaultVersion ();
4648 FileSignature configPath = null ;
47- if (editorConfigPath == null ) {
48- File defaultEditorConfig = new File (".editorconfig" );
49- if (defaultEditorConfig .exists ()) {
50- editorConfigPath = defaultEditorConfig .getPath ();
51- }
49+ if (editorConfigPath == null && defaultEditorConfig .exists ()) {
50+ editorConfigPath = defaultEditorConfig .getPath ();
5251 }
5352 if (editorConfigPath != null ) {
5453 configPath = ThrowingEx .get (() -> FileSignature .signAsList (stepConfig .getFileLocator ().locateFile (editorConfigPath )));
You can’t perform that action at this time.
0 commit comments