Skip to content

Conversation

@Pankraz76
Copy link
Contributor

Please DO NOT FORCE PUSH. Don't worry about messy history, it's easier to do code review if we can tell what happened after the review, and force pushing breaks that.

Please make sure that your PR allows edits from maintainers. Sometimes it's faster for us to just fix something than it is to describe how to fix it.

Allow edits from maintainers

After creating the PR, please add a commit that adds a bullet-point under the [Unreleased] section of CHANGES.md, plugin-gradle/CHANGES.md, and plugin-maven/CHANGES.md which includes:

  • a summary of the change
  • either
    • a link to the issue you are resolving (for small changes)
    • a link to the PR you just created (for big changes likely to have discussion)

If your change only affects a build plugin, and not the lib, then you only need to update the plugin-foo/CHANGES.md for that plugin.

If your change affects lib in an end-user-visible way (fixing a bug, updating a version) then you need to update CHANGES.md for both the lib and all build plugins. Users of a build plugin shouldn't have to refer to lib to see changes that affect them.

This makes it easier for the maintainers to quickly release your changes :)

}
groovyGradle {
target '*.gradle'
target '*.gradle', 'gradle/*.gradle'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need both ?

Copy link
Member

@jbduncan jbduncan Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I believe so, because:

  • *.gradle means "search for all files ending with .gradle in the project directory"
  • gradle/*.gradle means "search for all files ending with .gradle in the gradle subdirectory"

The alternative, **/*.gradle, which IIRC means "search for all files ending with .gradle in the project directory and every sub-directory", is slower than necessary because it searches through more things.

Copy link
Contributor Author

@Pankraz76 Pankraz76 Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative, **/*.gradle, which IIRC means "search for all files ending with .gradle in the project directory and every sub-directory", is slower than necessary because it searches through more things.

Thank you yes, was thinking about double as well, good layout.

slower than necessary

imho, code (simplicity, accessibility) over cpu.

Suggested change
target '*.gradle', 'gradle/*.gradle'
target '**.gradle'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you post here how long it takes to run Spotless before and after the change? If there's no noticeable difference and Ned is happy with it, then I'll accept it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will try.

IMO, Ned is pretty straightforward, having a good “doesn’t matter” mentality. Especially when it comes to chasing seconds around. IMO, it won’t take much longer, but I’m interested too, lets see.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that we do need both. And it's surprising how bad the performance of target '**/*.gradle' is. We used to have it, I think the problem is that it gobbles the .git folder too sometimes. Anyway, PR looked good as-is, merged.

apply from: rootProject.file('gradle/rewrite.gradle')
apply from: rootProject.file('gradle/spotless-freshmark.gradle')

spotless {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets avoid the redundancy if possible and follow:

  • separation of control instead of
  • duplication of control

@@ -1,5 +1,4 @@
apply plugin: 'org.openrewrite.rewrite'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets use block like done in spotless config.

@Pankraz76 Pankraz76 force-pushed the pr-fix-spotless-config branch from 0beb2c7 to 01aff7f Compare November 19, 2025 10:34
Signed-off-by: Vincent Potucek <[email protected]>
@Pankraz76 Pankraz76 force-pushed the pr-fix-spotless-config branch from 01aff7f to df4157b Compare November 19, 2025 10:36
@Pankraz76 Pankraz76 marked this pull request as ready for review November 19, 2025 10:36
@Pankraz76 Pankraz76 requested a review from jbduncan November 19, 2025 12:21
@nedtwigg nedtwigg merged commit b39368a into diffplug:main Nov 20, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants