-
Notifications
You must be signed in to change notification settings - Fork 464
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
Project build directory is not excluded when multiple targets are specified #835
Comments
@nedtwigg I am willing to contribute a fix for this issue, but I'm not quite sure what behaviour is desired. I think excluding the
There's still the case like Thoughts? |
I like your fix, but I think there is a simpler fix which works iff
Basically do a more strict "map reduce" with Does |
I like that simpler plan. I'm pretty sure that each file collection in a union has it's own set of includes and excludes, and I'll confirm how this interacts with the new "implicit dependency check" feature in Gradle 7. |
This commit broadens the set of patterns that are considered "recursive", and thus have automatic excludes applied for `.git`, `.gradle` and `build`. Any target starting with `**/` is now considered recursive. Fixes diffplug#835
Released in |
The
FormatExtension.parseTargetIsExclude()
method provides special handling to exclude.git
,.gradle
and project build output directory from processing, when the target matches the pattern**/*...
. This works well to avoid adding a bunch of spurious files to the Spotless inputs.Unfortunately, this handling is limited to the case where a single
target
is specified. So if a formatter is configured withtarget('**/*.kt', '**/*.kts')
then the project build output is not excluded from the inputs.In Gradle versions < 7.0, this is inefficient but does not result in any user errors/warnings.
In Gradle 7.0, this is more problematic: the build output directory is effectively an input to the Spotless task, resulting in a warning like this:
To reproduce this issue:
./gradlew clean spotlessCheck
Here is a build scan that results from this execution: https://scans.gradle.com/s/zw2f7glrsko7s/deprecations. Note that this does not include the "Execution optimizations have been disabled" message, but this shows on the console.
The text was updated successfully, but these errors were encountered: