From b9187ab18dea718d08403ea7bb28ec05c94d99f4 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Thu, 27 Mar 2025 13:31:14 +0100 Subject: [PATCH] docs: fix settings examples --- scripts/website/expand_templates/linters.go | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/scripts/website/expand_templates/linters.go b/scripts/website/expand_templates/linters.go index a6c0183863ce..0b6c88e5dfa2 100644 --- a/scripts/website/expand_templates/linters.go +++ b/scripts/website/expand_templates/linters.go @@ -379,18 +379,29 @@ func (e *ExampleSnippetsExtractor) getSettingSections(node, nextNode *yaml.Node) for i := 0; i < len(nextNode.Content); i += 2 { r := &yaml.Node{ - Kind: nextNode.Kind, - Style: nextNode.Style, + Kind: yaml.MappingNode, Tag: nextNode.Tag, Value: node.Value, Content: []*yaml.Node{ { - Kind: node.Kind, + Kind: yaml.ScalarNode, Value: node.Value, + Tag: node.Tag, }, { - Kind: nextNode.Kind, - Content: []*yaml.Node{nextNode.Content[i], nextNode.Content[i+1]}, + Kind: yaml.MappingNode, + Content: []*yaml.Node{ + { + Kind: yaml.ScalarNode, + Value: "settings", + Tag: node.Tag, + }, + { + Kind: yaml.MappingNode, + Tag: nextNode.Tag, + Content: []*yaml.Node{nextNode.Content[i], nextNode.Content[i+1]}, + }, + }, }, }, }