-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Build: Update spotless version and add spotless tasks #4077
Conversation
This adds the three spotless tasks to the build: ``` spotlessApply - Applies code formatting steps to sourcecode in-place. spotlessCheck - Checks that sourcecode satisfies formatting steps. spotlessDiagnose ```
@@ -48,6 +49,8 @@ subprojects { | |||
// import order. | |||
pluginManager.withPlugin('com.diffplug.spotless') { | |||
spotless { | |||
// don't run spotlessCheck during gradle check task | |||
enforceCheck = false |
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.
So is this just something we run ourselves or when does it get run?
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.
so previously the gradle spotless plugin was already there, but never enabled. This PR enables it and makes sure it doesn't run during the normal check
of Gradle because it will complain that the code format is off.
The implication of this is that we would run spotlessCheck
/ spotlessApply
manually for now until the format of the codebase is in a state where we can enforce this on CI. Bringing the codebase into this state is what I wanted to focus on in a separate PR/discussion and I started already talking to @rdblue about it.
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.
That makes sense to me.
Thank you for filling me in on the details as I've had less bandwidth for doing reviews than I normally do. Makes sense to add it in and then slowly updated over time. I'll be sure to remind people ocassionally to run spotlessCheck
during PRs.
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.
Additional work needs to happen (which I'm looking into) before we can have spotlessCheck
produce the actual code format that is desired btw :)
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.
This looks good to me but I have some questions, so a soft +1.
I'm a little confused on why we're adding the enforceCheck = false
. How does this change from the previous behavior? I see we didn't apply the plugin before so maybe that section is only now becoming relevant?
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.
This looks good to me!
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.
LGTM
This adds the three spotless tasks to the build: ``` spotlessApply - Applies code formatting steps to sourcecode in-place. spotlessCheck - Checks that sourcecode satisfies formatting steps. spotlessDiagnose ```
This adds the three spotless tasks to the build: