From af46bef5eab5fc8482e02f29e56f5373d02cb4c7 Mon Sep 17 00:00:00 2001 From: Christopher Haar Date: Tue, 1 Aug 2023 18:28:04 +0200 Subject: [PATCH 1/2] feat(docs): fix doc generation Signed-off-by: Christopher Haar --- pkg/registry/meta.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/registry/meta.go b/pkg/registry/meta.go index 0be317ed..aa426e31 100644 --- a/pkg/registry/meta.go +++ b/pkg/registry/meta.go @@ -187,7 +187,7 @@ func (r *Resource) findExampleBlock(file *hcl.File, blocks hclsyntax.Blocks, res continue } - if suffixMatch(b.Labels[0], *resourceName, 1) { + if suffixMatch(b.Labels[0], *resourceName, 1) || (strings.Contains(*resourceName, b.Labels[0]) && strings.Count(*resourceName, "_") == strings.Count(b.Labels[0], "_")) { *resourceName = b.Labels[0] exactMatch = true } else { From e9ef734a72bbdc7edff6a4426d336c6de6d28adc Mon Sep 17 00:00:00 2001 From: Christopher Haar Date: Tue, 1 Aug 2023 19:03:07 +0200 Subject: [PATCH 2/2] style(lint): add nolint:gocyclo Signed-off-by: Christopher Haar --- pkg/registry/meta.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/registry/meta.go b/pkg/registry/meta.go index aa426e31..0bf03c4c 100644 --- a/pkg/registry/meta.go +++ b/pkg/registry/meta.go @@ -173,7 +173,7 @@ func convertManifest2JSON(file *hcl.File, b *hclsyntax.Block) (string, error) { return out.String(), nil } -func (r *Resource) findExampleBlock(file *hcl.File, blocks hclsyntax.Blocks, resourceName *string, exactMatch bool) error { +func (r *Resource) findExampleBlock(file *hcl.File, blocks hclsyntax.Blocks, resourceName *string, exactMatch bool) error { //nolint:gocyclo dependencies := make(map[string]string) for _, b := range blocks { depKey := fmt.Sprintf("%s.%s", b.Labels[0], b.Labels[1])