You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Initial validate implementation
* Add function tests to TestFileMismatchCheck
* Add MixedDirectoryCheck and refactor relevant tests
* Add functions and guides to glob pattern
* Update README.md
* Update documentationDirGlob to pass tests
* Add copyright headers
* Resolve linting errors
* Update README.md with a link to provider documentation guidelines
* Resolve linting errors
* Add changelog entries
* Add `NumberOfFilesCheck` to validate
* Make file paths OS-agnostic
* Fix file path in test error assertion
* Update Go version to `1.21`
* Change wording to past tense on changelog entries
* Remove unused file
* Remove `filecheck` interface
* Refactor `schemamd` and `functionmd` packages to `internal/`
* Remove unused method
* Revert "Refactor `schemamd` and `functionmd` packages to `internal/`"
This reverts commit a1b156e.
* Remove go compatability section
* Switch to `yuin/goldmark` for frontmatter parsing
* Remove unused test
* Move global variables to top of file
* Refactor `testcases` to use `map[string]struct`
* Refactor to use `t.tempDir()`
* Fix documentationGlobPattern and add more debug and info logs
* Add negative scenario acceptance tests
Copy file name to clipboardExpand all lines: README.md
+22-1
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ Available commands are:
52
52
the generate command is run by default
53
53
generate generates a plugin website from code, templates, and examples
54
54
migrate migrates website files from either the legacy rendered website directory (`website/docs/r`) or the docs rendered website directory (`docs/resources`) to the tfplugindocs supported structure (`templates/`).
55
-
validate validates a plugin websitefor the current directory
--provider-dir <ARG> relative or absolute path to the root provider code directory; this will default to the current working directory if not set
86
+
--provider-name <ARG> provider name, as used in Terraform configurations
87
+
--providers-schema <ARG> path to the providers schema JSON file, which contains the output of the terraform providers schema -json command. Setting this flag will skip building the provider and calling Terraform CLI
88
+
--tf-version <ARG> terraform binary version to download. If not provided, will look for a terraform binary in the local environment. If not found in the environment, will download the latest version of Terraform
84
89
```
85
90
86
91
`migrate` command:
@@ -145,6 +150,22 @@ Otherwise, the provider developer can set an arbitrary description like this:
145
150
// ...
146
151
```
147
152
153
+
#### Validate subcommand
154
+
155
+
The `validate` subcommand can be used to validate the provider website documentation against the [Terraform Registry's provider documentation guidelines](https://developer.hashicorp.com/terraform/registry/providers/docs) and provider documentation best practices. The current checks in the `validate` command are:
| `InvalidDirectoriesCheck` | Checks for valid subdirectory structure and throws an error if an invalid Terraform Provider documentation subdirectory is found. |
160
+
| `MixedDirectoriesCheck` | Throws an error if both legacy documentation (`/website/docs`) and registry documentation (`/docs`) are found. |
161
+
| `NumberOfFilesCheck` | Throws an error if the number of files in a directory is larger than the registry limit. |
162
+
| `FileSizeCheck` | Throws an error if the documentation file is above the registry storage limit. |
163
+
| `FileExtensionCheck` | Throws an error if the extension of the given file is not a valid registry documentation extension. |
164
+
| `FrontMatterCheck` | Checks the YAML frontmatter of documentation for missing required fields or invalid fields. |
165
+
| `FileMismatchCheck` | Throws an error if the names/number of resources/datasources/functions in the provider schema does not match the names/number of files in the corresponding documentation directory |
166
+
167
+
All check errors are wrapped and returned as a single error message to stderr.
168
+
148
169
#### Migrate subcommand
149
170
150
171
The `migrate` subcommand can be used to migrate website files from either the legacy rendered website directory (`website/docs/r`) or the docs
0 commit comments