Bump github.com/hashicorp/terraform-plugin-docs from 0.15.0 to 0.16.0

Bumps [github.com/hashicorp/terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs) from 0.15.0 to 0.16.0.
- [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.15.0...v0.16.0)

---
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-07-10 20:16:39 +00:00
committed by GitHub
parent c1ba34b248
commit 04160fa7a3
25 changed files with 16775 additions and 2621 deletions

View File

@ -92,7 +92,7 @@ type CheckDynamicAddress struct {
//
// InstanceKey will be empty if there was no foreach or count argument
// defined on the containing object.
InstanceKey string `json:"instance_key,omitempty"`
InstanceKey interface{} `json:"instance_key,omitempty"`
}
// CheckResultStatic is the container for a "checkable object".

View File

@ -8,6 +8,7 @@ import (
"fmt"
"os"
"os/exec"
"path"
"path/filepath"
"runtime"
"strings"
@ -22,6 +23,7 @@ import (
"github.com/hashicorp/terraform-exec/tfexec"
tfjson "github.com/hashicorp/terraform-json"
"github.com/mitchellh/cli"
"golang.org/x/exp/slices"
)
var (
@ -63,6 +65,16 @@ var (
providerFileTemplate("index.html.markdown"),
providerFileTemplate("index.html.md"),
}
managedWebsiteSubDirectories = []string{
"data-sources",
"guides",
"resources",
}
managedWebsiteFiles = []string{
"index.md",
}
)
type generator struct {
@ -416,11 +428,34 @@ func (g *generator) renderMissingDocs(providerName string, providerSchema *tfjso
func (g *generator) renderStaticWebsite(providerName string, providerSchema *tfjson.ProviderSchema) error {
g.infof("cleaning rendered website dir")
err := os.RemoveAll(g.ProviderDocsDir())
dirEntry, err := os.ReadDir(g.ProviderDocsDir())
if err != nil {
return err
}
for _, file := range dirEntry {
// Remove subdirectories managed by tfplugindocs
if file.IsDir() && slices.Contains(managedWebsiteSubDirectories, file.Name()) {
g.infof("removing directory: %q", file.Name())
err = os.RemoveAll(path.Join(g.ProviderDocsDir(), file.Name()))
if err != nil {
return err
}
continue
}
// Remove files managed by tfplugindocs
if !file.IsDir() && slices.Contains(managedWebsiteFiles, file.Name()) {
g.infof("removing file: %q", file.Name())
err = os.RemoveAll(path.Join(g.ProviderDocsDir(), file.Name()))
if err != nil {
return err
}
continue
}
}
shortName := providerShortName(providerName)
g.infof("rendering templated website to static markdown")

View File

@ -98,6 +98,7 @@ func validateStaticDocs(ui cli.Ui, dir string) error {
"data-sources",
"guides",
"resources",
"cdktf",
),
checkBlockedExtensions(
".html.md.tmpl",