Skip to content

Stable API for Spotless? #579

@swankjesse

Description

@swankjesse

We upgraded from ktlint 0.33.0 to 0.34.2 and it caused our Spotless plugin to crash:

All input files are considered out-of-date for incremental task ':client:spotlessKotlin'.
Step 'ktlint' found problem in 'client/src/main/kotlin/com/squareup/cash/xxx/client/Xxxxx.kt':
com.pinterest.ktlint.core.KtLint.format(java.lang.String, java.lang.Iterable, java.util.Map, kotlin.jvm.functions.Function2)
java.lang.NoSuchMethodException: com.pinterest.ktlint.core.KtLint.format(java.lang.String, java.lang.Iterable, java.util.Map, kotlin.jvm.functions.Function2)
	at java.base/java.lang.Class.getMethod(Class.java:2108)
	at com.diffplug.spotless.kotlin.KtLintStep$State.createFormat(KtLintStep.java:140)
	at com.diffplug.spotless.FormatterStepImpl$Standard.format(FormatterStepImpl.java:76)
	at com.diffplug.spotless.FormatterStep$Strict.format(FormatterStep.java:76)
	at com.diffplug.spotless.Formatter.compute(Formatter.java:230)
	at com.diffplug.spotless.Formatter.applyToAndReturnResultIfDirty(Formatter.java:192)

Would it be worthwhile to lock down the API that Spotless uses to talk to Ktlint, so that Ktlint changes can’t break Spotless? Until that’s done it’s annoying to keep either project up-to-date.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions