diffplug / spotless

Keep your code spotless
Apache License 2.0
4.44k stars 449 forks source link

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

Open Goooler opened 3 months ago

Goooler commented 3 months ago
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 commented 3 months ago

removeUnusedImports() is conflicted with googleJavaFormat().

namero999 commented 3 months ago

Facing this as well. Any workaround so far?

Goooler commented 3 months ago

Workaround: remove removeUnusedImports().