-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task 'spotlessApply' not found in project ':api'. #27
Comments
Hello @fokkoru! subprojects {
apply(plugin = "com.diffplug.spotless")
} What exact task you are running: for the file or entire project? |
Hey @lipiridi So, the question is: do we really need to apply |
@fokkoru thanks for the answer. |
Yes, I see the window when I use 'Reformat Project,' but I need the option to reformat a single file. I want to use |
Now I see your point. It's fair. |
@fokkoru Hi again! I was working on the new flow, and while testing, I realized that Spotless from the root project isn't applying changes to the submodules. If it's not included in the submodule plugins, it doesn't work - neither by the plugin nor by manually running the task. Could you share your Gradle build snippets? |
Hmm, maybe it’s because I’m using Here’s how my root project looks: plugins {
kotlin("jvm") version "2.0.20" apply false
kotlin("kapt") version "2.0.20" apply false
id("com.diffplug.spotless") version "6.25.0"
}
spotless {
kotlin {
target("**/src/**/*.kt", "**/src/**/*.kts")
ktfmt().dropboxStyle().configure { opt -> opt.setMaxWidth(150) }
}
kotlinGradle {
target("*.gradle.kts", "**/*.gradle.kts")
ktfmt().dropboxStyle().configure { opt -> opt.setMaxWidth(150) }
}
java {
target("**/src/**/*.java")
removeUnusedImports()
palantirJavaFormat()
}
} |
Yeah, this is it. I had a default |
Version 1.1.3 was released. Will be available in the marketplace during 2 business days. |
It doesn’t work for me, giving the error:
Task 'spotlessApply' not found in project ':api'.
This error is correct because I set Spotless only for the root module, and it works with Gradle. I’m not sure why it requires adding the task to all modules.The text was updated successfully, but these errors were encountered: