You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are submitting a bug, please include the following:
[ 6.12.0 ] spotless version
This is stack trace:
java.lang.NoSuchMethodError: 'com.pinterest.ktlint.core.api.UsesEditorConfigProperties$EditorConfigProperty com.pinterest.ktlint.core.api.DefaultEditorConfigProperties.getKtlintDisabledRulesProperty()'
at com.diffplug.spotless.glue.ktlint.compat.KtLintCompat0Dot47Dot0Adapter.createEditorConfigOverride(KtLintCompat0Dot47Dot0Adapter.java:106)
at com.diffplug.spotless.glue.ktlint.compat.KtLintCompat0Dot47Dot0Adapter.format(KtLintCompat0Dot47Dot0Adapter.java:73)
at com.diffplug.spotless.glue.ktlint.KtlintFormatterFunc.applyWithFile(KtlintFormatterFunc.java:71)
at com.diffplug.spotless.FormatterFunc$NeedsFile.apply(FormatterFunc.java:154)
at com.diffplug.spotless.FormatterStepImpl$Standard.format(FormatterStepImpl.java:82)
at com.diffplug.spotless.FormatterStep$Strict.format(FormatterStep.java:88)
at com.diffplug.spotless.Formatter.compute(Formatter.java:230)
at com.diffplug.spotless.PaddedCell.calculateDirtyState(PaddedCell.java:203)
at com.diffplug.spotless.PaddedCell.calculateDirtyState(PaddedCell.java:190)
at com.diffplug.gradle.spotless.SpotlessTaskImpl.processInputFile(SpotlessTaskImpl.java:102)
at com.diffplug.gradle.spotless.SpotlessTaskImpl.performAction(SpotlessTaskImpl.java:88)
if (BadSemver.version(version) < BadSemver.version(0, 32)) {
I'm also tempted for Spotless to just drop support for all versions of KtLint except for the most recent to have a breaking change in its API. The maintenance load for this one formatter is relatively high...
Gradle defines semver wokring as expected only for major version above 0 (breaking changes reflected in major version). When major is 0, minor version reflects breaking changes.
Activity
Add support for KtLint 0.48.0 (fixes diffplug#1430)
Add support for KtLint 0.48.0 (fixes diffplug#1430)
bcmedeiros commentedon Dec 28, 2022
PR: #1432
Add support for KtLint 0.48.0 (fixes diffplug#1430)
Add support for KtLint 0.48.0 (#1432 fixes #1430)
nedtwigg commentedon Jan 2, 2023
Fixed in
plugin-gradle 6.12.1andplugin-maven 2.29.0thanks to @davidburstrom with help from @bcmedeiros.eirnym commentedon Jan 2, 2023
With these changes plugin doesn't work for ktlint
0.47.1and works for ktlint0.48.0I've tried
plugin-gradle 6.12.1davidburstrom commentedon Jan 2, 2023
Could you please elaborate on how it doesn't work?
nedtwigg commentedon Jan 2, 2023
Thanks for reporting. The version switch is here, this maybe has a bug for
0.47.1that it doesn't have for0.47.0.spotless/lib/src/ktlint/java/com/diffplug/spotless/glue/ktlint/KtlintFormatterFunc.java
Lines 44 to 51 in 86404f1
We should probably extend BadSemver to handle the
CinA.B.Cand then use thatspotless/lib/src/main/java/com/diffplug/spotless/kotlin/BadSemver.java
Lines 21 to 35 in 0fd20bb
example usage
spotless/lib/src/main/java/com/diffplug/spotless/kotlin/KtfmtStep.java
Line 177 in 552aabf
I'm also tempted for Spotless to just drop support for all versions of KtLint except for the most recent to have a breaking change in its API. The maintenance load for this one formatter is relatively high...
eirnym commentedon Jan 2, 2023
Gradle defines semver wokring as expected only for major version above 0 (breaking changes reflected in major version). When major is 0, minor version reflects breaking changes.
bcmedeiros commentedon Jan 3, 2023
I was trying to upgrade my project and bumped into another issue:
#1444