Skip to content

Commit fdfda94

Browse files
committed
docs(plugins): Mark optional plugin values
Avoid the impression that optional plugin values could be explicitly set to null. Fixes #10484. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent e2ee1a7 commit fdfda94

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

buildSrc/src/main/kotlin/GeneratePluginDocsTask.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,16 @@ abstract class GeneratePluginDocsTask : DefaultTask() {
124124
options.forEach {
125125
val defaultValue = it["default"]
126126
val type = it["type"]
127-
val isStringValue =
128-
(type == "SECRET" || type == "STRING" || type == "STRING_LIST") && defaultValue != null
127+
val isStringValue = type == "SECRET" || type == "STRING" || type == "STRING_LIST"
129128

130129
append("$i ${it["name"]}: ")
131-
if (isStringValue) append("\"")
132-
append(defaultValue)
133-
if (isStringValue) append("\"")
130+
if (defaultValue != null) {
131+
if (isStringValue) append("\"")
132+
append(defaultValue)
133+
if (isStringValue) append("\"")
134+
} else {
135+
append("<optional>")
136+
}
134137
appendLine()
135138
}
136139
}

0 commit comments

Comments
 (0)