Skip to content

Issue #34890: Use Spotless to reduce the pain on fixing checkstyle issues#34880

Closed
Pankraz76 wants to merge 1 commit intogradle:masterfrom
Pankraz76:into-spotless
Closed

Issue #34890: Use Spotless to reduce the pain on fixing checkstyle issues#34880
Pankraz76 wants to merge 1 commit intogradle:masterfrom
Pankraz76:into-spotless

Conversation

@Pankraz76
Copy link
Copy Markdown

@Pankraz76 Pankraz76 commented Sep 3, 2025

Issue #34890: Use Spotless to reduce the pain on fixing checkstyle issues

Im wondering how such a big projects does not follow the common path to apply the check burden with spot to improve the developer experience, as an example discussed in:

Also was trying to use rewrite to fix the wildcard imports but it does not scale.

Context

Contributor Checklist

  • Review Contribution Guidelines.
  • Make sure that all commits are signed off to indicate that you agree to the terms of Developer Certificate of Origin.
  • Make sure all contributed code can be distributed under the terms of the Apache License 2.0, e.g. the code was written by yourself or the original code is licensed under a license compatible to Apache License 2.0.
  • Check "Allow edit from maintainers" option in pull request so that additional changes can be pushed by Gradle team.
  • Provide integration tests (under <subproject>/src/integTest) to verify changes from a user perspective.
  • Provide unit tests (under <subproject>/src/test) to verify logic.
  • Update User Guide, DSL Reference, and Javadoc for public-facing changes.
  • Ensure that tests pass sanity check: ./gradlew sanityCheck.
  • Ensure that tests pass locally: ./gradlew <changed-subproject>:quickTest.

Reviewing cheatsheet

Before merging the PR, comments starting with

  • ❌ ❓must be fixed
  • 🤔 💅 should be fixed
  • 💭 may be fixed
  • 🎉 celebrate happy things

ref:

@bot-gradle bot-gradle added from:contributor PR by an external contributor to-triage labels Sep 3, 2025
Copy link
Copy Markdown
Author

@Pankraz76 Pankraz76 Sep 3, 2025

Choose a reason for hiding this comment

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

It seems ether check or the config is broken.

As check is kind of obsolete, serving mostly as a second gate, as automation tools like spot, or rewrite, can handle this much cheaper.

Copy link
Copy Markdown
Author

@Pankraz76 Pankraz76 left a comment

Choose a reason for hiding this comment

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

kindly request some feedback, thanks.

If this is any good we could undo the changes and start with unused stuff, making the diff smaller as spot as fixed a lot of check gaps.

Comment thread gradle.properties Outdated
Copy link
Copy Markdown
Author

@Pankraz76 Pankraz76 Sep 3, 2025

Choose a reason for hiding this comment

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

plz how to fix this?

Did not worked out with: ./gradlew --write-verification-metadata sha256 help

Suggested change
org.gradle.dependency.verification=lenient
org.gradle.dependency.verification=strict
* What went wrong:
A problem occurred configuring root project 'gradle'.
> Dependency verification failed for configuration 'classpath'
  7 artifacts failed verification:
    - durian-swt.os-4.3.0.jar (com.diffplug.durian:durian-swt.os:4.3.0) from repository Gradle Central Plugin Repository
    - org.eclipse.osgi-3.23.100.jar (org.eclipse.platform:org.eclipse.osgi:3.23.100) from repository Gradle Central Plugin Repository
    - solstice-1.8.1.jar (dev.equo.ide:solstice:1.8.1) from repository Gradle Central Plugin Repository
    - spotless-lib-3.3.1.jar (com.diffplug.spotless:spotless-lib:3.3.1) from repository Gradle Central Plugin Repository
    - spotless-lib-extra-3.3.1.jar (com.diffplug.spotless:spotless-lib-extra:3.3.1) from repository Gradle Central Plugin Repository
    - spotless-plugin-gradle-7.2.1.jar (com.diffplug.spotless:spotless-plugin-gradle:7.2.1) from repository Gradle Central Plugin Repository
    - xz-1.9.jar (org.tukaani:xz:1.9) from repository Gradle Central Plugin Repository
  This can indicate that a dependency has been compromised. Please carefully verify the signatures and checksums. Key servers are disabled, this can indicate that you need to update the local keyring with the missing keys.
  
  Open this report for more details: file:///Users/vincent.potucek/IdeaProjects/gradle/build/reports/dependency-verification/at-1756896991953/dependency-verification-report.html

Comment thread pmd.xml Outdated
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

@ov7a ov7a left a comment

Choose a reason for hiding this comment

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

Thank you for being interested in improving the code quality of OSS.

While this PR has some potential useful changes, most of them are white-space ones.
There are unused imports, but they are in the code that predates the configuration of code-quality tools we have. I believe it will be autofixed once any change will be done to these files.

Regarding the setup: we don't think it should be set up as a GH action. We already have sanity check task with static analysis tools enabled.

Lastly, we write our gradle scripts with Kotlin Script, not Groovy. And verification failures is a no-go.

I don't think we have a solid reason to change the static analysis tool at this point.

Given that the PR is mostly white space and has little impact on users, closing this.

@ov7a ov7a closed this Sep 4, 2025
@ov7a ov7a added closed:not-fixed Indicates the issue was not fixed and is not planned to be and removed to-triage labels Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closed:not-fixed Indicates the issue was not fixed and is not planned to be from:contributor PR by an external contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants