tfproviderdocs
tfproviderdocs copied to clipboard
check: Implement optional page content title Resource: and Data Source: prefix check
In larger Terraform Providers, a common strategy to help operators distinguish between resource and data source pages has been adding a Resource: or Data Source: prefix to the page content title (the h1 header in the Markdown). This should be behind a check command flag for now such as -require-resource-page-title-prefix. If diagnostics are in place, then this should be enabled as a warning by default and the flag promotes it to an error.
Failing cases (either resource or data source file):
---
# ... Frontmatter ...
---
# example_thing
Byline.
Passing case (resource):
---
# ... Frontmatter ...
---
# Resource: example_thing
Byline.
Passing case (data source):
---
# ... Frontmatter ...
---
# Data Source: example_thing
Byline.
Experimental support for this has been added via new -enable-contents-check flag in version 0.8.0 of tfproviderdocs.
This project will be archived in preference of the revamped validate command in github.com/hashicorp/terraform-plugin-docs implementing much of the basic validation logic from this project. Feature requests should be submitted over there at this point.