Skip to content

7.0.0.BETA1: Multiple steps with name 'google-java-format' for spotless format 'java' #2159

Closed

Description

@Goooler
plugins {
    id 'com.diffplug.spotless' version '7.0.0.BETA1'
}

spotless {
    java {
        target("compatLib/**/src/**/*.java")
        googleJavaFormat().aosp()
        removeUnusedImports()
    }
    kotlin {
        target("lawnchair/src/**/*.kt")
        ktlint().customRuleSets([
            "io.nlopez.compose.rules:ktlint:0.4.3",
        ]).editorConfigOverride([
            "ktlint_compose_compositionlocal-allowlist": "disabled",
        ])
    }
}
Could not determine the dependencies of task ':spotlessApply'.
> Could not create task ':spotlessJavaApply'.
   > Could not create task ':spotlessJava'.
      > Multiple steps with name 'google-java-format' for spotless format 'java'

Reproducer: LawnchairLauncher/lawnchair#4450

Activity

  1. Goooler commented on Jun 5, 2024

    @Goooler
    MemberAuthor

    removeUnusedImports() is conflicted with googleJavaFormat().

  2. namero999 commented on Jun 6, 2024

    @namero999

    Facing this as well. Any workaround so far?

  3. Goooler commented on Jun 6, 2024

    @Goooler
    MemberAuthor

    Workaround: remove removeUnusedImports().

  4. nedtwigg commented on Oct 31, 2024

    @nedtwigg
    Member

    It's because the removeUnusedImports step is naming itself google-java-format. Easy to fix with a bit of plumbing...

  5. added a commit that references this issue on Nov 6, 2024
    0259785
  6. nedtwigg commented on Jan 7, 2025

    @nedtwigg
    Member

    Fixed in 7.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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