Skip to content

[core] add IDE agnostic configuration thus run spotlessApply on dev environment #1265

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Pankraz76
Copy link

@Pankraz76 Pankraz76 commented Jun 27, 2025

Automating Code Formatting with Spotless in Gradle

By binding the spotlessApply goal to local execution, we can automatically fix formatting issues during a single Gradle build when triggered for every push. This approach offers two key benefits:

  1. Time savings: Eliminates back-and-forth CI/CD cycles for formatting fixes
  2. Resource efficiency: Reduces cloud compute usage

This pattern is already well-established in major projects:

Current Limitations and Proof of Concept

While the concept is proven in Maven environments, Gradle/Spotless integration currently requires additional configuration:

Example of formatting workflow

Copy link

google-cla bot commented Jun 27, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Pankraz76 Pankraz76 force-pushed the apply-spotless-format branch from daff237 to 97acd62 Compare June 27, 2025 21:31
@Pankraz76 Pankraz76 marked this pull request as ready for review June 27, 2025 21:31
@@ -0,0 +1,14 @@
/*
* Copyright 2016 Google Inc.
Copy link
Author

Choose a reason for hiding this comment

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

is this the desired version?

There are currently three different version:

image


<parent>
<groupId>com.google.googlejavaformat</groupId>
<artifactId>google-java-format-parent</artifactId>
Copy link
Author

Choose a reason for hiding this comment

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

is this an issue having SSOT ?

<id>spotless-apply</id>
<phase>process-sources</phase>
<goals>
<goal>apply</goal>
Copy link
Author

Choose a reason for hiding this comment

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

disable on CI

@Pankraz76 Pankraz76 force-pushed the apply-spotless-format branch from 97acd62 to 60e09f2 Compare June 29, 2025 09:11
@Pankraz76
Copy link
Author

google seems dead.

Agreement Name Date Signed Manage
Google Individual CLA vincent potucek Jun 27, 2025 05:50 PDT Edit Contact Information

@Pankraz76 Pankraz76 closed this Jul 4, 2025
@Pankraz76 Pankraz76 reopened this Aug 6, 2025
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.

1 participant