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

Conversation

Pankraz76
Copy link
Contributor

@Pankraz76 Pankraz76 commented Jun 24, 2025

apply spotlessApply on dev environment

image

FYI: @jbduncan

@@ -31,3 +31,9 @@ spotless {
greclipse().configFile rootProject.files('gradle/spotless.eclipseformat.xml', 'gradle/spotless.groovyformat.prefs')
}
}
tasks.named('build') {
dependsOn 'spotlessApply'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

how to disable this on cloud?

it should not run there, as waste of time thus potentially cause issues.

@Pankraz76 Pankraz76 marked this pull request as ready for review June 24, 2025 19:29
@Pankraz76 Pankraz76 changed the title apply autofix for dev system apply spotlessApply on dev environment Jun 24, 2025
@@ -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.

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.

2 participants