diff --git a/go.mod b/go.mod index 4533b8bf3..7c9e59aeb 100644 --- a/go.mod +++ b/go.mod @@ -204,7 +204,7 @@ require ( github.com/wavefronthq/wavefront-sdk-go v0.15.0 github.com/x448/float16 v0.8.4 github.com/xdg/scram v1.0.5 - github.com/yuin/goldmark v1.6.0 + github.com/yuin/goldmark v1.7.8 go.mongodb.org/mongo-driver v1.17.0 go.opentelemetry.io/collector/pdata v1.12.0 go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0 diff --git a/go.sum b/go.sum index e9ca22afc..63914f27e 100644 --- a/go.sum +++ b/go.sum @@ -2427,8 +2427,8 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68= -github.com/yuin/goldmark v1.6.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic= +github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/gopher-lua v0.0.0-20200603152657-dc2b0ca8b37e/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da h1:NimzV1aGyq29m5ukMK0AMWEhFaL/lrEOaephfuoiARg= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= diff --git a/tools/license_checker/main.go b/tools/license_checker/main.go index 1fa5d26de..69ea22e91 100644 --- a/tools/license_checker/main.go +++ b/tools/license_checker/main.go @@ -139,9 +139,9 @@ func main() { for lineElementNode := lineRoot.FirstChild().FirstChild(); lineElementNode != nil; lineElementNode = lineElementNode.NextSibling() { switch v := lineElementNode.(type) { case *ast.Text: - name += string(v.Text(line)) + name += string(v.Value(line)) case *ast.Link: - license = string(v.Text(line)) + license = string(v.FirstChild().(*ast.Text).Value(line)) link = string(v.Destination) default: debugf("ignoring unknown element %T (%v)", v, v) diff --git a/tools/readme_config_includer/generator.go b/tools/readme_config_includer/generator.go index e2c0b7b96..2d8c76960 100644 --- a/tools/readme_config_includer/generator.go +++ b/tools/readme_config_includer/generator.go @@ -165,7 +165,7 @@ func main() { if lines.Len() > 0 { stop = lines.At(lines.Len() - 1).Stop } - txt = node.Info.Text(readme) + txt = node.Info.Value(readme) re = tomlIncludesEx case *ast.Heading: if node.ChildCount() < 2 { @@ -186,6 +186,7 @@ func main() { if rawnode.Lines().Len() > 0 { stop = rawnode.Lines().At(0).Start - h.Level - 1 } else { + //nolint:staticcheck // need to use this since we aren't sure the type log.Printf("heading without lines: %s", string(rawnode.Text(readme))) stop = start // safety measure to prevent removing all text } diff --git a/tools/readme_linter/assert.go b/tools/readme_linter/assert.go index 798284452..f54a92ca8 100644 --- a/tools/readme_linter/assert.go +++ b/tools/readme_linter/assert.go @@ -118,6 +118,7 @@ func (t *T) assertFirstChildRegexp(expectedPattern string, n ast.Node) { } c := n.FirstChild() + //nolint:staticcheck // need to use this since we aren't sure the type actual := string(c.Text(t.markdown)) if !validRegexp.MatchString(actual) { diff --git a/tools/readme_linter/rules.go b/tools/readme_linter/rules.go index b883601f4..125d2627c 100644 --- a/tools/readme_linter/rules.go +++ b/tools/readme_linter/rules.go @@ -31,7 +31,7 @@ func firstSection(t *T, root ast.Node) error { // Make sure there is some text after the heading n = n.NextSibling() t.assertKind(ast.KindParagraph, n) - length := len(n.Text(t.markdown)) + length := len(n.(*ast.Paragraph).Lines().Value(t.markdown)) if length < 30 { t.assertNodef(n, "short first section. Please add short description of plugin. length %d, minimum 30", length) } @@ -62,6 +62,7 @@ func requiredSections(t *T, root ast.Node, headings []string) error { if child == nil { continue } + //nolint:staticcheck // need to use this since we aren't sure the type title := strings.TrimSpace(string(child.Text(t.markdown))) if headingsSet.has(title) && h.Level != expectedLevel { t.assertNodef(n, "has required section %q but wrong heading level. Expected level %d, found %d", @@ -155,6 +156,7 @@ func configSection(t *T, root ast.Node) error { continue } + //nolint:staticcheck // need to use this since we aren't sure the type title := string(h.FirstChild().Text(t.markdown)) if title == expectedTitle { config = h