spotless icon indicating copy to clipboard operation
spotless copied to clipboard

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

Open Goooler opened this issue 1 year ago • 3 comments

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: https://github.com/LawnchairLauncher/lawnchair/pull/4450

Goooler avatar Jun 04 '24 11:06 Goooler

removeUnusedImports() is conflicted with googleJavaFormat().

Goooler avatar Jun 05 '24 08:06 Goooler

Facing this as well. Any workaround so far?

namero999 avatar Jun 06 '24 10:06 namero999

Workaround: remove removeUnusedImports().

Goooler avatar Jun 06 '24 10:06 Goooler

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

nedtwigg avatar Oct 31 '24 19:10 nedtwigg

Fixed in 7.0.0

nedtwigg avatar Jan 07 '25 00:01 nedtwigg