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 31
31
import com .diffplug .spotless .maven .FormatterStepFactory ;
32
32
33
33
public class Ktlint implements FormatterStepFactory {
34
+ private static final File defaultEditorConfig = new File (".editorconfig" );
35
+
34
36
@ Parameter
35
37
private String version ;
36
38
@ Parameter
@@ -44,11 +46,8 @@ public class Ktlint implements FormatterStepFactory {
44
46
public FormatterStep newFormatterStep (final FormatterStepConfig stepConfig ) {
45
47
String ktlintVersion = version != null ? version : KtLintStep .defaultVersion ();
46
48
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 ();
52
51
}
53
52
if (editorConfigPath != null ) {
54
53
configPath = ThrowingEx .get (() -> FileSignature .signAsList (stepConfig .getFileLocator ().locateFile (editorConfigPath )));
You can’t perform that action at this time.
0 commit comments