Skip to content

Adding example of passing JSON as a rewrite.options argument value#1013

Merged
steve-aom-elliott merged 5 commits into
mainfrom
steve-testing-json-args
Jul 16, 2025
Merged

Adding example of passing JSON as a rewrite.options argument value#1013
steve-aom-elliott merged 5 commits into
mainfrom
steve-testing-json-args

Conversation

@steve-aom-elliott

@steve-aom-elliott steve-aom-elliott commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

What's changed?

  • Added a new example to show an example of passing a JSON string for a rewrite.options option.

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

… Adding functionality to swap slash direction in checks based on the local file system so that the tests should be able to be re-enabled for Windows
@steve-aom-elliott steve-aom-elliott self-assigned this Jul 15, 2025
@steve-aom-elliott steve-aom-elliott added the documentation Improvements or additions to documentation label Jul 15, 2025
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Jul 15, 2025
Comment thread src/test/java/org/openrewrite/maven/RewriteRunIT.java Outdated
@openrewrite openrewrite deleted a comment from timtebeek Jul 16, 2025
…t runner that doesn't play nice rather than the plugin itself.
@steve-aom-elliott

Copy link
Copy Markdown
Contributor Author

@timtebeek I ended up removing the changes that were intended to try to support Windows, as it turns out it's actually the test runner that doesn't play nice rather than the actual plugin. Turns out the answer when running on command line is to not escape it at all:

mvn -U org.openrewrite.maven:rewrite-maven-plugin:6.12.1:run -Drewrite.activeRecipes=org.openrewrite.java.AddCommentToMethod -Drewrite.options=comment='{"test":{"some":"yeah"}}',methodPattern="sample.SomeClass doTheThing(..)" -e

@steve-aom-elliott steve-aom-elliott moved this from In Progress to Ready to Review in OpenRewrite Jul 16, 2025
@steve-aom-elliott steve-aom-elliott merged commit 12dc370 into main Jul 16, 2025
2 checks passed
@steve-aom-elliott steve-aom-elliott deleted the steve-testing-json-args branch July 16, 2025 16:46
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Jul 16, 2025
mergify Bot added a commit to robfrank/linklift that referenced this pull request Aug 15, 2025
…2.1 to 6.16.0 [skip ci]

Bumps [org.openrewrite.maven:rewrite-maven-plugin](https://github.com/openrewrite/rewrite-maven-plugin) from 6.12.1 to 6.16.0.
Release notes

*Sourced from [org.openrewrite.maven:rewrite-maven-plugin's releases](https://github.com/openrewrite/rewrite-maven-plugin/releases).*

> 6.16.0
> ------
>
> What's Changed
> --------------
>
> * chore(ci): bump org.junit:junit-bom from 5.13.3 to 5.13.4 by [`@​dependabot`](https://github.com/dependabot)[bot] in [openrewrite/rewrite-maven-plugin#1017](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1017)
> * rename settings.local.json to settings.json by [`@​zieka`](https://github.com/zieka) in [openrewrite/rewrite-maven-plugin#1018](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1018)
> * chore(ci): bump org.assertj:assertj-bom from 3.27.3 to 3.27.4 by [`@​dependabot`](https://github.com/dependabot)[bot] in [openrewrite/rewrite-maven-plugin#1020](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1020)
> * chore(ci): bump actions/download-artifact from 4 to 5 by [`@​dependabot`](https://github.com/dependabot)[bot] in [openrewrite/rewrite-maven-plugin#1021](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1021)
>
> **Full Changelog**: <openrewrite/rewrite-maven-plugin@v6.15.0...v6.16.0>
>
> 6.15.0
> ------
>
> What's Changed CLI
> ------------------
>
> * [OpenRewrite v8.59.1](https://github.com/openrewrite/rewrite/releases/tag/v8.59.1)
>
> **Full Changelog**: <openrewrite/rewrite-maven-plugin@v6.14.0...v6.15.0>
>
> 6.14.0
> ------
>
> What's Changed
> --------------
>
> * Adding example of passing JSON as a `rewrite.options` argument value by [`@​steve-aom-elliott`](https://github.com/steve-aom-elliott) in [openrewrite/rewrite-maven-plugin#1013](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1013)
> * chore(ci): bump io.micrometer:micrometer-core from 1.15.1 to 1.15.2 by [`@​dependabot`](https://github.com/dependabot)[bot] in [openrewrite/rewrite-maven-plugin#1012](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1012)
> * chore(ci): bump org.apache.maven.plugins:maven-enforcer-plugin from 3.6.0 to 3.6.1 by [`@​dependabot`](https://github.com/dependabot)[bot] in [openrewrite/rewrite-maven-plugin#1016](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1016)
> * chore(ci): bump maven-dependencies.version from 3.9.10 to 3.9.11 by [`@​dependabot`](https://github.com/dependabot)[bot] in [openrewrite/rewrite-maven-plugin#1015](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1015)
>
> New Contributors
> ----------------
>
> * [`@​steve-aom-elliott`](https://github.com/steve-aom-elliott) made their first contribution in [openrewrite/rewrite-maven-plugin#1013](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1013)
>
> **Full Changelog**: <openrewrite/rewrite-maven-plugin@v6.13.0...v6.14.0>
>
> 6.13.0
> ------
>
> What's Changed
> --------------
>
> * chore(ci): bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.7 to 3.2.8 by [`@​dependabot`](https://github.com/dependabot) in [openrewrite/rewrite-maven-plugin#1007](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1007)
> * chore(ci): bump org.apache.maven.plugins:maven-enforcer-plugin from 3.5.0 to 3.6.0 by [`@​dependabot`](https://github.com/dependabot) in [openrewrite/rewrite-maven-plugin#1008](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1008)
> * chore(ci): bump org.junit:junit-bom from 5.13.2 to 5.13.3 by [`@​dependabot`](https://github.com/dependabot) in [openrewrite/rewrite-maven-plugin#1009](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1009)
> * chore(ci): bump org.apache.maven:maven-api-xml from 4.0.0-rc-3 to 4.0.0-rc-4 by [`@​dependabot`](https://github.com/dependabot) in [openrewrite/rewrite-maven-plugin#1002](https://redirect.github.com/openrewrite/rewrite-maven-plugin/pull/1002)
>
> **Full Changelog**: <openrewrite/rewrite-maven-plugin@v6.12.1...v6.13.0>


Commits

* [`37e5d64`](openrewrite/rewrite-maven-plugin@37e5d64) [maven-release-plugin] prepare release v6.16.0
* [`a89b40e`](openrewrite/rewrite-maven-plugin@a89b40e) Bump rewrite.version property
* [`cd74841`](openrewrite/rewrite-maven-plugin@cd74841) Simplify `throws` statements of tests
* [`6517fa2`](openrewrite/rewrite-maven-plugin@6517fa2) chore(ci): bump actions/download-artifact from 4 to 5 ([#1021](https://redirect.github.com/openrewrite/rewrite-maven-plugin/issues/1021))
* [`b6018fc`](openrewrite/rewrite-maven-plugin@b6018fc) chore(ci): bump org.assertj:assertj-bom from 3.27.3 to 3.27.4 ([#1020](https://redirect.github.com/openrewrite/rewrite-maven-plugin/issues/1020))
* [`10393ce`](openrewrite/rewrite-maven-plugin@10393ce) rename settings.local.json to settings.json ([#1018](https://redirect.github.com/openrewrite/rewrite-maven-plugin/issues/1018))
* [`39f2837`](openrewrite/rewrite-maven-plugin@39f2837) Create Claude settings file
* [`6317586`](openrewrite/rewrite-maven-plugin@6317586) refactor: Static imports for Collections and Collectors
* [`97eeccf`](openrewrite/rewrite-maven-plugin@97eeccf) refactor: Equals avoids null
* [`b9e83ad`](openrewrite/rewrite-maven-plugin@b9e83ad) Update repository-backup.yml to drop illegal timeout-minutes
* Additional commits viewable in [compare view](openrewrite/rewrite-maven-plugin@v6.12.1...v6.16.0)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=org.openrewrite.maven:rewrite-maven-plugin&package-manager=maven&previous-version=6.12.1&new-version=6.16.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants