Sign inSign up

moab4x/tfproviderdocs

By moab4x

•Updated 4 months ago

HashiCorp Terraform Provider documentation testing and linting

Image
Integration & delivery
0

1.3K

moab4x/tfproviderdocs repository overview

⁠check Command

The tfproviderdocs check command verifies the Terraform Provider documentation against the specifications from Terraform Registry documentation⁠ and common practices across official Terraform Providers. This includes the following checks:

  • Verifies that no invalid directories are found in the documentation directory structure.
  • Ensures that there is not a mix (legacy and Terraform Registry) of directory structures, which is not supported during Terraform Registry documentation ingress.
  • Verifies number of documentation files is below Terraform Registry storage limits.
  • Verifies all known data sources and resources have an associated documentation file (if -providers-schema-json is provided)
  • Verifies no extraneous or incorrectly named documentation files exist (if -providers-schema-json is provided)
  • Verifies each file in the documentation directories is valid.

The validity of files is checked with the following rules:

  • Proper file extensions are used (e.g. .md for Terraform Registry).
  • Verifies size of file is below Terraform Registry storage limits.
  • YAML frontmatter can be parsed and matches expectations.

The YAML frontmatter checks include some defaults (e.g. no layout field for Terraform Registry), but there are some useful flags that can be passed to the command to tune the behavior, especially for larger Terraform Providers.

The validity of files can also be experimentally checked (via the -enable-contents-check flag) with the following rules:

  • Ensures all expected headings are present.
  • Verifies heading levels and text.
  • Verifies schema attribute lists are ordered (if -require-schema-ordering is provided). Only supports section level lists (not sub-section level lists) currently.
  • Verifies resource type is present in code blocks (e.g. examples and import sections).

For additional information about check flags, you can run tfproviderdocs check -help.

Tag summary

Content type

Image

Digest

sha256:c6ee595e7…

Size

325.5 MB

Last updated

4 months ago

docker pull moab4x/tfproviderdocs