bflad/tfproviderdocs


Terraform Provider Documentation Tool

License: MPL-2.0

Language: Go


tfproviderdocs

A documentation tool for Terraform Provider code.

Install

Local Install

Release binaries are available in the Releases section.

To instead use Go to install into your $GOBIN directory (e.g. $GOPATH/bin):

go install github.com/bflad/tfproviderdocs

Docker Install

docker pull bflad/tfproviderdocs

Homebrew Install

brew install bflad/tap/tfproviderdocs

Usage

Additional information about usage and configuration options can be found by passing the help argument:

tfproviderdocs help

Local Usage

Change into the directory of the Terraform Provider code and run:

tfproviderdocs

Docker Usage

Change into the directory of the Terraform Provider code and run:

docker run -v $(pwd):/src bflad/tfproviderdocs

Available Commands

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.

Development and Testing

This project uses Go Modules for dependency management.

Go Compatibility

This project follows the Go support policy for versions. The two latest major releases of Go are supported by the project.

Currently, that means Go 1.19 or later must be used when including this project as a dependency.

Updating Dependencies

Dependency updates are managed via Dependabot.

Unit Testing

go test ./...

Local Install Testing

go install .

Project Statistics

Sourcerank 11
Repository Size 202 KB
Stars 21
Forks 5
Watchers 3
Open issues 5
Dependencies 31
Contributors 5
Tags 21
Created
Last updated
Last pushed

Top Contributors See all

Brian Flad dependabot[bot] Daniel Schmidt kt Jared Baker

Packages Referencing this Repo

github.com/bflad/tfproviderdocs
Terraform Provider Documentation Tool
Latest release v0.12.1 - Updated - 21 stars

Recent Tags See all

v0.12.1 May 19, 2024
v0.12.0 March 06, 2024
v0.11.1 July 11, 2023
v0.11.0 June 02, 2023
v0.10.0 May 31, 2023
v0.9.1 February 25, 2021
v0.9.0 February 25, 2021
v0.8.0 October 26, 2020
v0.7.0 July 31, 2020
v0.6.0 May 10, 2020
v0.5.3 May 08, 2020
v0.5.2 May 07, 2020
v0.5.1 May 07, 2020
v0.5.0 February 10, 2020
v0.4.1 January 09, 2020

Interesting Forks See all

YakDriver/tfproviderdocs
Terraform Provider Documentation Tool
Go - MPL-2.0 - Last pushed - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2024-05-20 16:57:57 UTC

Login to resync this repository