From 4845ce1e0f2b7d30a7b900e57d86b2a7e30c1b40 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Mon, 24 Feb 2025 09:17:46 +0100 Subject: [PATCH] Remove obsolete filtering from setComment This reverts the change that we made in 3b85307f67dc, it is no longer needed now. --- pkg/jsonschema/generate_config_docs.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/jsonschema/generate_config_docs.go b/pkg/jsonschema/generate_config_docs.go index 731cddea9..b5228c042 100644 --- a/pkg/jsonschema/generate_config_docs.go +++ b/pkg/jsonschema/generate_config_docs.go @@ -77,20 +77,13 @@ func prepareMarshalledConfig(buffer bytes.Buffer) []byte { } func setComment(yamlNode *yaml.Node, description string) { - // Filter out lines containing "[dev]"; this allows us to add developer - // documentation to properties that don't get included in the docs - lines := strings.Split(description, "\n") - lines = lo.Filter(lines, func(s string, _ int) bool { - return !strings.Contains(s, "[dev]") - }) - // Workaround for the way yaml formats the HeadComment if it contains // blank lines: it renders these without a leading "#", but we want a // leading "#" even on blank lines. However, yaml respects it if the // HeadComment already contains a leading "#", so we prefix all lines // (including blank ones) with "#". yamlNode.HeadComment = strings.Join( - lo.Map(lines, func(s string, _ int) string { + lo.Map(strings.Split(description, "\n"), func(s string, _ int) string { if s == "" { return "#" // avoid trailing space on blank lines }