Skip to content

Commit

Permalink
Check if EditorConfig file exist for Ktlint in KotlinGradleExtension
Browse files Browse the repository at this point in the history
Follow up 959fd85.
  • Loading branch information
Goooler committed Nov 18, 2023
1 parent 379a03d commit fdb85bf
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ public class KotlinFormatExtension {
}

public KotlinFormatExtension setEditorConfigPath(Object editorConfigPath) throws IOException {

if (editorConfigPath == null) {
this.editorConfigPath = null;
} else {
this.editorConfigPath = FileSignature.signAsList(getProject().file(editorConfigPath));
File editorConfigFile = getProject().file(editorConfigPath);
if (!editorConfigFile.exists()) {
throw new IllegalArgumentException("EditorConfig file does not exist: " + editorConfigFile);
}
this.editorConfigPath = FileSignature.signAsList(editorConfigFile);
}
replaceStep(createStep());
return this;
Expand Down

0 comments on commit fdb85bf

Please sign in to comment.