Skip to content

apply spotlessApply on dev environment #2528

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gradle/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ spotless {
greclipse().configFile rootProject.files('gradle/spotless.eclipseformat.xml', 'gradle/spotless.groovyformat.prefs')
}
}
if (System.env['CI'] == null) {
tasks.named('spotlessCheck') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
tasks.named('spotlessCheck') {
tasks.named('build') {

could use build as well, this seem most simple way.
Any objection?

Copy link
Member

Choose a reason for hiding this comment

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

I have advised against running spotlessApply automatically for some time now.

I want to enable people to do whatever they want in their own projects, but Spotless ought to be developed with its defaults imo.

Copy link
Contributor Author

@Pankraz76 Pankraz76 Jun 25, 2025

Choose a reason for hiding this comment

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

Spotless ought to be developed with its defaults imo

Yes, agreed — Convention over Configuration is always a good principle. Automatically applying fixes during development builds out of the box would really help serve customers better.

The hard part is determining when something is running in CI vs. local development.

Assuming this is a new feature:

Not having auto-fix in the dev build wastes time. This needs to stop. The current tradeoff ends up wasting effort instead of supplementing local fixes until we can deliver this out-of-the-box with Spot — which would actually uphold the Convention over Configuration principle we both agree on.

dependsOn 'spotlessApply'
mustRunAfter 'spotlessApply'
}
}
Loading