Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend YAML CommentOutProperty with option to keep original property uncommented #4740

Closed
ashakirin opened this issue Dec 4, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ashakirin
Copy link
Contributor

Currently YAML CommentOutProperty adds the comment and always comments out original property.
To be consistent with property AddPropertyComment recipe, introduce the option to keep original property and just add a comment.
In the future, it would be nice to align the names and parameters for YAML CommentOutProperty and property AddPropertyComment recipes

@ashakirin ashakirin added the enhancement New feature or request label Dec 4, 2024
ashakirin pushed a commit to ashakirin/rewrite that referenced this issue Dec 4, 2024
timtebeek added a commit that referenced this issue Dec 5, 2024
* feat: Added option to comment out property in yaml

Refs: #4740

* Update rewrite-yaml/src/main/java/org/openrewrite/yaml/CommentOutProperty.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update rewrite-yaml/src/main/java/org/openrewrite/yaml/CommentOutProperty.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Handle nullable Boolean correctly for usage from rewrite.yml

* Drop unused default

* Prevent double negation

* Adopt `else if`

---------

Co-authored-by: Andrei Shakirin <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tim te Beek <[email protected]>
@timtebeek
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants