ktlint-gradle
ktlint-gradle copied to clipboard
Set KtLint version to 0.43.2
Should set this to 0.43.1 now.
@JLLeitschuh can we please get this upgrade into a version of the Gradle plugin? Would be great to update for new Ktlint features.
@zsmb13 0.43.1 just fixes KtLint CLI issue and does not affect Gradle plugin itself. Regarding version update - you could always to update it via ktlint extesion: version.set("0.43.1")
Should set this to 0.43.1 now.
@JLLeitschuh can we please get this upgrade into a version of the Gradle plugin? Would be great to update for new Ktlint features.
"Note: Please do not use the 0.43.1 release" Note from here:0.43.2
I had another look and tests seem to be failing with this error message:
* What went wrong:
Execution failed for task ':runKtlintCheckOverMainSourceSet'.
> A failure occurred while executing org.jlleitschuh.gradle.ktlint.worker.KtLintWorkAction
> Could not initialize class com.pinterest.ktlint.ruleset.experimental.trailingcomma.TrailingCommaRule
Version 0.43.0 introduced a new TrailingCommaRule and I'm afraid fixing this bug is beyond my capabilities. I am willing to give it a shot if someone wants to point me in the right direction, otherwise unfortunately I'll have to leave this one for more knowledgeable contributors.
I think it's not related to TrailingCommaRule but related to Kotlin API 1.4 usage
I got that error on running tests :
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':runKtlintCheckOverMainSourceSet'.
> Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing org.jlleitschuh.gradle.ktlint.worker.KtLintWorkAction
> Caused by: java.lang.NoSuchMethodError: 'void kotlin.jvm.internal.MutablePropertyReference1Impl.<init>(java.lang.Class, java.lang.String, java.lang.String, int)'
at com.pinterest.ktlint.ruleset.experimental.trailingcomma.TrailingCommaRule.<clinit>(TrailingCommaRule.kt:37)
void kotlin.jvm.internal.MutablePropertyReference1Impl.<init>(java.lang.Class, java.lang.String, java.lang.String, int) has the annotation @SinceKotlin(version = "1.4")
Indeed, ktlint upgraded their API version to 1.4 since the 0.43.0
I suppose from this comment that we have to upgrade gradle plugins as well in order to support 0.38.0 and versions 0.43+ : https://github.com/JLLeitschuh/ktlint-gradle/blob/477a00779f30cb3262758e495ea966d2272efbb2/plugin/src/test/kotlin/org/jlleitschuh/gradle/ktlint/KtLintSupportedVersionsTest.kt#L105
I believe that this is now outdated by #597, correct?