Skip to content

Commit

Permalink
Only print yaml options if required or has example
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Dec 13, 2023
1 parent f17d59b commit beaabd1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,9 @@ class RecipeMarkdownGenerator : Runnable {
""".trimIndent()
)
for (option in recipeDescriptor.options) {
if (!option.isRequired && option.example == null) {
continue
}
val ex = if (option.example != null && "String" == option.type
&& (option.example.matches("^[{}\\[\\],`|=%@*!?-].*".toRegex())
|| option.example.matches(".*:\\s.*".toRegex()))
Expand Down

0 comments on commit beaabd1

Please sign in to comment.