Skip to content

Spotless Gradle 6.23.2: Cannot access 'configure': it is private in 'ConfigurableStyle' #1921

Closed
@Komdosh

Description

@Komdosh

After update from 6.22.0 to 6.23.2 can't configure ktfmt style.

ktfmt().kotlinlangStyle().configure {
    it.setMaxWidth(120)
    it.setRemoveUnusedImport(true)
}

Error:

e: file:///project/build.gradle.kts:233:26: Cannot access 'configure': it is private in 'ConfigurableStyle'

In 6.23.0 there was a problem with private BaseKotlinConfigure (changed from 6.22.0). In 6.23.2 - BaseKotlinConfigure is public now. But method configure is still private in KtfmtConfig.

public class ConfigurableStyle {
  private void configure(Consumer<KtfmtStep.KtfmtFormattingOptions> optionsConfiguration) {
            KtfmtStep.KtfmtFormattingOptions ktfmtFormattingOptions = new KtfmtStep.KtfmtFormattingOptions();
            optionsConfiguration.accept(ktfmtFormattingOptions);
            options = ktfmtFormattingOptions;
            replaceStep(createStep());
  }
}

Spotless Gradle version is 6.23.2.

If you are submitting a bug, please include the following:

  • summary of problem
  • Gradle or Maven version
  • spotless version
  • operating system and version
  • copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
  • copy-paste the full content of any console errors emitted by gradlew spotless[Apply/Check] --stacktrace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions