spotless
spotless copied to clipboard
Support using Gradle projects as the dependency inputs
I'd finished Ktlint custom rule sets support in #1896, but it supports Maven coordinates only due to the limits of
https://github.com/diffplug/spotless/blob/0189f717ee13acdb00745bffa86c6ed4ede53ef2/lib/src/main/java/com/diffplug/spotless/JarState.java#L56-L59
We can extend this for Gradle local projects to be used as the inputs, not sure if this way works for Maven projects as well.
Another workable way is using spotless
configuration like
dependencies {
spotless("org.junit.jupiter:junit-jupiter:5.10.0")
spotless(libs.jupiter)
spotless(projects.b)
...
}
I guess this is an intended behavior of not using it?
I'm running into this as well. I've created a new rule in the same (gradle) project that I'd like to apply it which doesn't seem possible at the moment.
Another workable way is using
spotless
configuration likedependencies { spotless("org.junit.jupiter:junit-jupiter:5.10.0") spotless(libs.jupiter) spotless(projects.b) ... }
I guess this is an intended behavior of not using it?
Are you saying there already is such a spotless
configuration and it's already possible to use Gradle projects as dependencies? Because if you are, it's not working for me. And I would really like to have this feature.
Not yet, it's a proposal. There are some issues related to reuse configurations:
https://github.com/diffplug/spotless/blob/a6d2e615556b7acbf570b581470570f1ea12cef2/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/GradleProvisioner.java#L116-L132
@bgaudiosi I'm running into this as well. I've created a new rule in the same (gradle) project that I'd like to apply it which doesn't seem possible at the moment.
I solved this problem by releasing a custom ruleset module to MavenLocal and using it.