Skip to content

fix: add Spotless skip flags to Maven and Gradle validation#1946

Open
mashraf-222 wants to merge 1 commit intomainfrom
cf-1080-spotless-skip
Open

fix: add Spotless skip flags to Maven and Gradle validation#1946
mashraf-222 wants to merge 1 commit intomainfrom
cf-1080-spotless-skip

Conversation

@mashraf-222
Copy link
Copy Markdown
Contributor

Problem

Instrumented test files (*__perfinstrumented.java) fail Spotless Maven/Gradle format checks. The validation skip flag lists did not include Spotless, causing build failures on projects like Apache Flink (Spotless 2.43.0), Kafka, and Beam.

Root Cause

_MAVEN_VALIDATION_SKIP_FLAGS in maven_strategy.py and _GRADLE_SKIP_VALIDATION_INIT_SCRIPT in gradle_strategy.py were missing Spotless entries. They already skipped rat, checkstyle, spotbugs, pmd, enforcer, japicmp, and errorprone — but not Spotless.

Fix

Maven: Added -Dspotless.check.skip=true and -Dspotless.apply.skip=true to _MAVEN_VALIDATION_SKIP_FLAGS.

Gradle: Added spotlessCheck, spotlessApply, spotlessJava, spotlessKotlin, spotlessScala to the task disable list in the init script.

Validation

Verified flag works on Apache Flink:

$ mvn spotless:check -pl flink-core -Dspotless.check.skip=true
[INFO] BUILD SUCCESS

Test Coverage

  • test_maven_skip_flags_include_spotless — verifies both Spotless flags present
  • test_maven_skip_flags_include_all_known_plugins — verifies all plugin families covered
  • test_gradle_skip_script_includes_spotless — verifies Gradle script disables Spotless tasks

Closes CF-1080

Instrumented test files fail Spotless format checks on projects like
Apache Flink, Kafka, and Beam. Adds -Dspotless.check.skip=true and
-Dspotless.apply.skip=true to Maven, and spotlessCheck/Apply/Java/
Kotlin/Scala task disabling to the Gradle init script.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 1, 2026

Claude finished @mashraf-222's task in 1m 54s —— View job


PR Review Summary

  • Triage PR size — SMALL (4 lines of production code changed)
  • Lint and typecheck — clean (prek passes, mypy clean)
  • Resolve stale threads — none
  • Code review
  • Duplicate detection

Prek Checks

No issues. All linting, formatting, and type checks pass.

Code Review

The fix is correct and minimal. No bugs, security issues, or breaking changes.

One minor observation: spotlessCheck and spotlessApply are Gradle aggregate tasks that run all language-specific Spotless tasks. The additional language-specific tasks (spotlessJava, spotlessKotlin, spotlessScala) are therefore redundant — but harmless. Missing variants like spotlessGroovy, spotlessXml, etc. are covered by the aggregates, so there's no gap.

No action required on this.

Duplicate Detection

No duplicates detected. The skip flags are defined exactly once each (_MAVEN_VALIDATION_SKIP_FLAGS in maven_strategy.py, _GRADLE_SKIP_VALIDATION_INIT_SCRIPT in gradle_strategy.py).

Test Coverage

Three targeted tests added for the new flags — appropriate for this change. Tests verify both Maven flags and the three Gradle Spotless task names.


LGTM. The fix is straightforward and well-tested.

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