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
  • Loading branch information
nedtwigg authored Nov 20, 2023
2 parents 379a03d + 2ff556b commit d8415a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
## [Unreleased]
### Fixed
* Fix Eclipse JDT on some settings files. ([#1864](https://github.com/diffplug/spotless/pull/1864) fixes [#1638](https://github.com/diffplug/spotless/issues/1638))
* Check if EditorConfig file exist for Ktlint in KotlinGradleExtension. ([#1889](https://github.com/diffplug/spotless/pull/1889)
### Changes
* Bump default `ktlint` version to latest `1.0.0` -> `1.0.1`. ([#1855](https://github.com/diffplug/spotless/pull/1855))
### Fixed
Expand Down
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 d8415a5

Please sign in to comment.