Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Conversation

shanman190
Copy link
Contributor

What's changed?

Add support for writing out version catalogs, such that they can be used within unit tests.

What's your motivation?

Enable more snippets that are parseable in tests.

Anything in particular you'd like reviewers to focus on?

Nothing in particular

Anyone you would like to review specifically?

Anybody

Have you considered any alternatives or workarounds?

N/A

Any additional context

I noticed that version catalogs weren't yet supported in test cases as part of verifying the test snippets as part of openrewrite/rewrite#5574. Conventionally, I've limited version catalogs to the format included here of gradle/*.versions.toml, however version catalogs can technically carry any file name. This just seemed like a good middle ground though from a conventional standpoint.

See Version Catalogs for more information.

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@shanman190 shanman190 self-assigned this Jun 19, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Jun 19, 2025
@shanman190 shanman190 added the enhancement New feature or request label Jun 19, 2025
@shanman190
Copy link
Contributor Author

shanman190 commented Jun 19, 2025

The test failure here is due to not having rewrite-toml on the classpath yet. I've added it to rewrite-gradle as an implementation dependency via the associated PR which will then enable supporting future work against version catalogs within rewrite-gradle itself.

Copy link
Member

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

🚀

@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Jun 19, 2025
@shanman190 shanman190 merged commit 151377c into main Jul 29, 2025
1 of 2 checks passed
@shanman190 shanman190 deleted the feature/testing-with-version-catalogs branch July 29, 2025 01:54
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Jul 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants