Add comment to a YAML property

Apache 2.0

Add a comment to a YAML property. The comment will be added on the line before the property.

org.openrewrite.yaml.AddCommentToProperty

Required

The property key to add a comment to. Supports glob patterns.

The comment to add to the property. A multi-line comment is added as one comment line per line.

Optional

relaxedBindingBoolean

Whether to match the propertyKey using relaxed binding rules. Defaults to true. If you want to use exact matching in your search, set this to false.

A glob expression representing a file path to search for (relative to the project root). Blank/null matches all.

mod run . --recipe=org.openrewrite.yaml.AddCommentToProperty \ -P propertyKey='management.metrics.binders.*.enabled' \ -P comment='This property is deprecated'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.