Skip to content

Commit

Permalink
fix "additionalEditorconfig not supported until ktlint 0.49" warning …
Browse files Browse the repository at this point in the history
…when additionalEditorconfig is not being used
  • Loading branch information
wakingrufus committed Sep 22, 2023
1 parent 23d0c9e commit ec0d3a3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

- fix "additionalEditorconfig not supported until ktlint 0.49" warning [#712](https://github.com/JLLeitschuh/ktlint-gradle/pull/712)
- update latest version text file manually [#709](https://github.com/JLLeitschuh/ktlint-gradle/pull/709)
- Improve error logging [#711](https://github.com/JLLeitschuh/ktlint-gradle/pull/711)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ abstract class KtLintWorkAction : WorkAction<KtLintWorkAction.KtLintWorkParamete
logger.warn("additionalEditorconfigFile no longer supported in ktlint 0.47+")
}
if (parameters.additionalEditorconfig.isPresent &&
parameters.additionalEditorconfig.get().isNotEmpty() &&
parameters.ktLintVersion.map { SemVer.parse(it) }.get() < SemVer(0, 49)
) {
logger.warn("additionalEditorconfig not supported until ktlint 0.49")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ class KtLintSupportedVersionsTest : AbstractPluginTest() {
buildAndFail(CHECK_PARENT_TASK_NAME) {
assertThat(task(":$mainSourceSetCheckTaskName")?.outcome).isEqualTo(TaskOutcome.FAILED)
assertThat(output).contains("additionalEditorconfigFile no longer supported in ktlint 0.47+")
assertThat(output).doesNotContain("additionalEditorconfig not supported until ktlint 0.49")
}
} else {
build(CHECK_PARENT_TASK_NAME) {
assertThat(task(":$mainSourceSetCheckTaskName")?.outcome).isEqualTo(TaskOutcome.SUCCESS)
assertThat(output).doesNotContain("additionalEditorconfig not supported until ktlint 0.49")
}
}
}
Expand Down

0 comments on commit ec0d3a3

Please sign in to comment.