-
Notifications
You must be signed in to change notification settings - Fork 487
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
Conversation
gradle/spotless.gradle
Outdated
@@ -31,3 +31,9 @@ spotless { | |||
greclipse().configFile rootProject.files('gradle/spotless.eclipseformat.xml', 'gradle/spotless.groovyformat.prefs') | |||
} | |||
} | |||
tasks.named('build') { | |||
dependsOn 'spotlessApply' |
There was a problem hiding this comment.
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.
spotlessApply
on dev environment
@@ -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') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tasks.named('spotlessCheck') { | |
tasks.named('build') { |
could use build
as well, this seem most simple way.
Any objection?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
apply
spotlessApply
on dev environmentspotlessApply
on dev environment #2525FYI: @jbduncan