Skip to content
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

Merged
merged 1 commit into from
Apr 1, 2022

Conversation

nastra
Copy link
Contributor

@nastra nastra commented Feb 9, 2022

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:

```
spotlessApply - Applies code formatting steps to sourcecode in-place.
spotlessCheck - Checks that sourcecode satisfies formatting steps.
spotlessDiagnose
```
@nastra nastra changed the title Build: Update spotless version and enable it Build: Update spotless version and add spotless tasks Feb 9, 2022
@@ -48,6 +49,8 @@ subprojects {
// import order.
pluginManager.withPlugin('com.diffplug.spotless') {
spotless {
// don't run spotlessCheck during gradle check task
enforceCheck = false
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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 :)

Copy link
Contributor

@kbendick kbendick left a 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?

Copy link
Contributor

@kbendick kbendick left a 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!

Copy link
Member

@snazy snazy left a comment

Choose a reason for hiding this comment

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

LGTM

@rymurr rymurr merged commit 445bc61 into apache:master Apr 1, 2022
@nastra nastra deleted the spotless branch April 1, 2022 13:41
kbendick pushed a commit to kbendick/iceberg that referenced this pull request Apr 4, 2022
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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants