openrewrite / openrewrite/rewrite
`@Option` should probably have `defaultValue` attribute
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 570
- Avg merge
- 13h 12m
- Merged PRs (30d)
- 261
Description
In addition to the example attribute it would probably make sense to also have a defaultValue attribute for the @Option annotation. One use case would be for boolean-types properties, where the default is documented to be true. Example: https://github.com/openrewrite/rewrite/blob/52da683b518791943685e2c0bedabbfb0bac5771/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteProperty.java#L51-L57
In the SaaS UI the checkbox is rendered unticked (i.e. false) even though the description mentions that the default is true so in the end it isn't even quite clear to the user what it means for the checkbox to be unticked.

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the @Option annotation definition and the referenced DeleteProperty.java example, then trace how option metadata reaches the SaaS UI. Define what defaultValue should represent for boolean options and verify that the UI uses it when rendering the checkbox; the issue is done when documented true defaults are unambiguous there.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100