Skip to content

Fix style precedence in DefaultProjectParser#426

Merged
timtebeek merged 4 commits intomainfrom
timtebeek/fix-ci-failures
Feb 27, 2026
Merged

Fix style precedence in DefaultProjectParser#426
timtebeek merged 4 commits intomainfrom
timtebeek/fix-ci-failures

Conversation

@timtebeek
Copy link
Member

@timtebeek timtebeek commented Feb 26, 2026

Summary

Fixes failing tests caused by upstream OpenRewrite change to NamedStyles.merge() semantics in

That fix now correctly implements "last wins" precedence, but the gradle plugin was adding configured styles first and autodetected styles second, causing autodetected styles to incorrectly override configured ones.

Changes

Moved configured style application from addProvenance() to a new applyConfiguredStyles() method that runs after applyAutodetected(). This ensures configured styles take precedence as intended.

Test Plan

  • ✅ Local test run passes all 40 tests (previously 2 failing style-related tests)
  • reformatToIntelliJStyle now correctly applies IntelliJ 4-space indentation style
  • mergeConfiguredAndAutodetectedStyles now correctly applies tab indentation style

Reorder style application so configured styles are added after autodetected styles, ensuring they take precedence under the corrected NamedStyles.merge() behavior.
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Feb 26, 2026
@timtebeek timtebeek added the bug Something isn't working label Feb 26, 2026
@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Feb 26, 2026
The upstream UpdateGradleWrapper recipe now uses downloads.gradle.org instead of services.gradle.org.
@timtebeek timtebeek merged commit 7103580 into main Feb 27, 2026
1 check passed
@timtebeek timtebeek deleted the timtebeek/fix-ci-failures branch February 27, 2026 11:57
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants