currently we use ktlint version: "0.43.2", when trying to update this to e.g. "0.45.0" we get the following error:
$ gw ktLintFormat --stacktrace
-----------
* What went wrong:
Execution failed for task ':backend:runKtlintFormatOverTestSourceSet'.
> A failure occurred while executing org.jlleitschuh.gradle.ktlint.worker.KtLintWorkAction
> 'void com.pinterest.ktlint.core.Rule.<init>(java.lang.String)'
...
Caused by: java.lang.NoSuchMethodError: 'void com.pinterest.ktlint.core.Rule.<init>(java.lang.String)'
at com.pinterest.ktlint.ruleset.standard.CommentSpacingRule.<init>(CommentSpacingRule.kt:11)
at org.gradle.kotlin.dsl.ktlint.ruleset.GradleKotlinDslRuleSetProvider.get(GradleKotlinDslRuleSetProvider.kt:48)
at org.jlleitschuh.gradle.ktlint.worker.KtLintWorkAction.loadRuleSetsFromClasspath(KtLintWorkAction.kt:106)
at org.jlleitschuh.gradle.ktlint.worker.KtLintWorkAction.loadRuleSetsAndFilterThem(KtLintWorkAction.kt:95)
at org.jlleitschuh.gradle.ktlint.worker.KtLintWorkAction.execute(KtLintWorkAction.kt:20)
I encountered the same problem. Upgrading the Kotlin and ktlint versions for our custom rules worked for me, but that required some effort due to deprecations, breaking changes on 0.45, and new rules
we configure the plugin like this:
currently we use ktlint version: "0.43.2", when trying to update this to e.g. "0.45.0" we get the following error: