Skip to content

Unable to use ktfmt 0.47+ due to FormattingOptions.copy incompatibility #2043

@LukasVoda

Description

@LukasVoda
  • Gradle: 7.6.1
  • Spotless Gradle: 6.25.0

When using Spotless via Gradle with the latest version of ktfmt (0.47 at the time of posting this issue) Spotless crashes due to backwards incompatible changes introduced in fa78077aad.

Specifically, Spotless relies on the class com.facebook.ktfmt.format.FormattingOptions's method copy to have 6 arguments, but the above mentioned commit added a new argument manageTrailingCommas . This breaks binary compatibility and causes Spotless to throw an exception (reference).

This bug only manifests when users pass Ktfmt formatting options to the Ktfmt Spotless step configuration.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions