Bump github.com/hashicorp/terraform-plugin-docs from 0.13.0 to 0.14.1

Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.13.0 to 0.14.1.
- [Release notes](https://github.com/hashicorp/terraform-plugin-docs/releases)
- [Changelog](https://github.com/hashicorp/terraform-plugin-docs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/terraform-plugin-docs/compare/v0.13.0...v0.14.1)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/terraform-plugin-docs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2023-03-21 15:09:33 +00:00
committed by GitHub
parent 6ce5f8bf9f
commit abc332958b
11 changed files with 64 additions and 79 deletions

View File

@ -1,3 +1,5 @@
Copyright (c) 2020 HashiCorp, Inc.
Mozilla Public License Version 2.0
==================================

View File

@ -42,7 +42,7 @@ func (cmd *generateCmd) Help() string {
}
})
strBuilder.WriteString(fmt.Sprintf("\nUsage: tfplugindocs generate [<args>]\n\n"))
strBuilder.WriteString("\nUsage: tfplugindocs generate [<args>]\n\n")
cmd.Flags().VisitAll(func(f *flag.Flag) {
if f.DefValue != "" {
strBuilder.WriteString(fmt.Sprintf(" --%s <ARG> %s%s%s (default: %q)\n",

View File

@ -30,7 +30,7 @@ func (cmd *validateCmd) Help() string {
}
})
strBuilder.WriteString(fmt.Sprintf("\nUsage: tfplugindocs validate [<args>]\n\n"))
strBuilder.WriteString("\nUsage: tfplugindocs validate [<args>]\n\n")
cmd.Flags().VisitAll(func(f *flag.Flag) {
if f.DefValue != "" {
strBuilder.WriteString(fmt.Sprintf(" --%s <ARG> %s%s%s (default: %q)\n",

View File

@ -130,13 +130,9 @@ func (options *Text) Emphasis(out *bytes.Buffer, text []byte) {
out.Write(text)
}
func (options *Text) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {
return
}
func (options *Text) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {}
func (options *Text) LineBreak(out *bytes.Buffer) {
return
}
func (options *Text) LineBreak(out *bytes.Buffer) {}
func (options *Text) Link(out *bytes.Buffer, link []byte, title []byte, content []byte) {
out.Write(content)
@ -144,12 +140,9 @@ func (options *Text) Link(out *bytes.Buffer, link []byte, title []byte, content
out.WriteString(" ")
out.Write(link)
}
return
}
func (options *Text) RawHtmlTag(out *bytes.Buffer, text []byte) {
return
}
func (options *Text) RawHtmlTag(out *bytes.Buffer, text []byte) {}
func (options *Text) TripleEmphasis(out *bytes.Buffer, text []byte) {
out.Write(text)
@ -159,9 +152,7 @@ func (options *Text) StrikeThrough(out *bytes.Buffer, text []byte) {
out.Write(text)
}
func (options *Text) FootnoteRef(out *bytes.Buffer, ref []byte, id int) {
return
}
func (options *Text) FootnoteRef(out *bytes.Buffer, ref []byte, id int) {}
func (options *Text) Entity(out *bytes.Buffer, entity []byte) {
out.Write(entity)
@ -171,25 +162,15 @@ func (options *Text) NormalText(out *bytes.Buffer, text []byte) {
out.Write(text)
}
func (options *Text) Smartypants(out *bytes.Buffer, text []byte) {
return
}
func (options *Text) Smartypants(out *bytes.Buffer, text []byte) {}
func (options *Text) DocumentHeader(out *bytes.Buffer) {
return
}
func (options *Text) DocumentHeader(out *bytes.Buffer) {}
func (options *Text) DocumentFooter(out *bytes.Buffer) {
return
}
func (options *Text) DocumentFooter(out *bytes.Buffer) {}
func (options *Text) TocHeader(text []byte, level int) {
return
}
func (options *Text) TocHeader(text []byte, level int) {}
func (options *Text) TocFinalize() {
return
}
func (options *Text) TocFinalize() {}
func doubleSpace(out *bytes.Buffer) {
if out.Len() > 0 {

View File

@ -3,7 +3,6 @@ package provider
import (
"context"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
@ -128,7 +127,7 @@ func (g *generator) Generate(ctx context.Context) error {
switch {
case g.websiteTmpDir == "":
g.websiteTmpDir, err = ioutil.TempDir("", "tfws")
g.websiteTmpDir, err = os.MkdirTemp("", "tfws")
if err != nil {
return err
}
@ -249,7 +248,7 @@ func (g *generator) renderMissingResourceDoc(providerName, name, typeName string
fallbackTmplPath = filepath.Join(g.websiteTmpDir, g.websiteSourceDir, fallbackTmplPath)
if fileExists(fallbackTmplPath) {
g.infof("resource %q fallback template exists", name)
tmplData, err := ioutil.ReadFile(fallbackTmplPath)
tmplData, err := os.ReadFile(fallbackTmplPath)
if err != nil {
return fmt.Errorf("unable to read file %q: %w", fallbackTmplPath, err)
}
@ -377,7 +376,7 @@ func (g *generator) renderStaticWebsite(providerName string, providerSchema *tfj
g.infof("rendering templated website to static markdown")
err = filepath.Walk(g.websiteTmpDir, func(path string, info os.FileInfo, err error) error {
err = filepath.Walk(g.websiteTmpDir, func(path string, info os.FileInfo, _ error) error {
if info.IsDir() {
// skip directories
return nil
@ -410,7 +409,7 @@ func (g *generator) renderStaticWebsite(providerName string, providerSchema *tfj
renderedPath = strings.TrimSuffix(renderedPath, ext)
tmplData, err := ioutil.ReadFile(path)
tmplData, err := os.ReadFile(path)
if err != nil {
return fmt.Errorf("unable to read file %q: %w", rel, err)
}
@ -492,7 +491,7 @@ func (g *generator) terraformProviderSchema(ctx context.Context, providerName st
shortName := providerShortName(providerName)
tmpDir, err := ioutil.TempDir("", "tfws")
tmpDir, err := os.MkdirTemp("", "tfws")
if err != nil {
return nil, err
}

View File

@ -3,7 +3,6 @@ package provider
import (
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
@ -78,7 +77,7 @@ func writeFile(path string, data string) error {
return fmt.Errorf("unable to make dir %q: %w", dir, err)
}
err = ioutil.WriteFile(path, []byte(data), 0644)
err = os.WriteFile(path, []byte(data), 0644)
if err != nil {
return fmt.Errorf("unable to write file %q: %w", path, err)
}
@ -90,7 +89,7 @@ func runCmd(cmd *exec.Cmd) ([]byte, error) {
output, err := cmd.CombinedOutput()
if err != nil {
log.Printf("error executing %q, %v", cmd.Path, cmd.Args)
log.Printf(string(output))
log.Print(string(output))
return nil, fmt.Errorf("error executing %q: %w", cmd.Path, err)
}
return output, nil

View File

@ -2,7 +2,6 @@ package tmplfuncs
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
@ -21,7 +20,7 @@ func CodeFile(format, file string) (string, error) {
}
fullPath := filepath.Join(wd, file)
content, err := ioutil.ReadFile(fullPath)
content, err := os.ReadFile(fullPath)
if err != nil {
return "", fmt.Errorf("unable to read content from %q: %w", file, err)
}

View File

@ -12,11 +12,12 @@ import (
// Render writes a Markdown formatted Schema definition to the specified writer.
// A Schema contains a Version and the root Block, for example:
// "aws_accessanalyzer_analyzer": {
// "block": {
// },
// "version": 0
// },
//
// "aws_accessanalyzer_analyzer": {
// "block": {
// },
// "version": 0
// },
func Render(schema *tfjson.Schema, w io.Writer) error {
_, err := io.WriteString(w, "## Schema\n\n")
if err != nil {
@ -178,26 +179,27 @@ func writeRootBlock(w io.Writer, block *tfjson.SchemaBlock) error {
// * Description(Kind)
// * Deprecated flag
// For example:
// "block": {
// "attributes": {
// "certificate_arn": {
// "description_kind": "plain",
// "required": true,
// "type": "string"
// }
// },
// "block_types": {
// "timeouts": {
// "block": {
// "attributes": {
// },
// "description_kind": "plain"
// },
// "nesting_mode": "single"
// }
// },
// "description_kind": "plain"
// },
//
// "block": {
// "attributes": {
// "certificate_arn": {
// "description_kind": "plain",
// "required": true,
// "type": "string"
// }
// },
// "block_types": {
// "timeouts": {
// "block": {
// "attributes": {
// },
// "description_kind": "plain"
// },
// "nesting_mode": "single"
// }
// },
// "description_kind": "plain"
// },
func writeBlockChildren(w io.Writer, parents []string, block *tfjson.SchemaBlock, root bool) error {
names := []string{}
for n := range block.Attributes {

12
vendor/modules.txt vendored
View File

@ -108,8 +108,8 @@ github.com/hashicorp/terraform-exec/tfexec
# github.com/hashicorp/terraform-json v0.16.0
## explicit; go 1.18
github.com/hashicorp/terraform-json
# github.com/hashicorp/terraform-plugin-docs v0.13.0
## explicit; go 1.17
# github.com/hashicorp/terraform-plugin-docs v0.14.1
## explicit; go 1.18
github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
github.com/hashicorp/terraform-plugin-docs/internal/cmd
github.com/hashicorp/terraform-plugin-docs/internal/mdplain
@ -176,11 +176,11 @@ github.com/huandu/xstrings
# github.com/imdario/mergo v0.3.13
## explicit; go 1.13
github.com/imdario/mergo
# github.com/mattn/go-colorable v0.1.12
## explicit; go 1.13
# github.com/mattn/go-colorable v0.1.13
## explicit; go 1.15
github.com/mattn/go-colorable
# github.com/mattn/go-isatty v0.0.14
## explicit; go 1.12
# github.com/mattn/go-isatty v0.0.16
## explicit; go 1.15
github.com/mattn/go-isatty
# github.com/mitchellh/cli v1.1.5
## explicit; go 1.11