Skip to content

Commit

Permalink
Refactor schemamd and functionmd packages to internal/
Browse files Browse the repository at this point in the history
  • Loading branch information
SBGoods committed Mar 13, 2024
1 parent cc6300a commit a1b156e
Show file tree
Hide file tree
Showing 28 changed files with 14 additions and 17 deletions.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ The `validate` subcommand can be used to validate the provider website documenta
|---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `InvalidDirectoriesCheck` | Checks for valid subdirectory structure and throws an error if an invalid Terraform Provider documentation subdirectory is found. |
| `MixedDirectoriesCheck` | Throws an error if both legacy documentation (`/website/docs`) and registry documentation (`/docs`) are found. |
| `NumberOfFilesCheck` | Throws an error if the number of files in a directory is larger than the registry limit. |
| `FileSizeCheck` | Throws an error if the documentation file is above the registry storage limit. |
| `NumberOfFilesCheck` | Throws an error if the number of files in a directory is larger than the public registry limit. |
| `FileSizeCheck` | Throws an error if the documentation file is above the public registry storage limit. |
| `FileExtensionCheck` | Throws an error if the extension of the given file is not a valid registry documentation extension. |
| `FrontMatterCheck` | Checks the YAML frontmatter of documentation for missing required fields or invalid fields. |
| `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 |
Expand Down Expand Up @@ -327,12 +327,6 @@ Your help and patience is truly appreciated.

## Contributing

## Go Compatibility

This project follows the [support policy](https://golang.org/doc/devel/release.html#policy) of Go as its support policy. The two latest major releases of Go are supported by the project.

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

### License Headers
All source code files in this repository (excluding autogenerated files like `go.mod`, prose, and files excluded in [.copywrite.hcl](.copywrite.hcl)) must have a license header at the top.

Expand Down
2 changes: 1 addition & 1 deletion functionmd/render.go → internal/functionmd/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

tfjson "github.com/hashicorp/terraform-json"

"github.com/hashicorp/terraform-plugin-docs/schemamd"
"github.com/hashicorp/terraform-plugin-docs/internal/schemamd"
)

// RenderArguments returns a Markdown formatted string of the function arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/google/go-cmp/cmp"
tfjson "github.com/hashicorp/terraform-json"

"github.com/hashicorp/terraform-plugin-docs/functionmd"
"github.com/hashicorp/terraform-plugin-docs/internal/functionmd"
)

func TestRenderArguments(t *testing.T) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions internal/provider/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (

tfjson "github.com/hashicorp/terraform-json"

"github.com/hashicorp/terraform-plugin-docs/functionmd"
"github.com/hashicorp/terraform-plugin-docs/internal/functionmd"
"github.com/hashicorp/terraform-plugin-docs/internal/mdplain"
"github.com/hashicorp/terraform-plugin-docs/internal/schemamd"
"github.com/hashicorp/terraform-plugin-docs/internal/tmplfuncs"
"github.com/hashicorp/terraform-plugin-docs/schemamd"
)

const (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion schemamd/render_test.go → internal/schemamd/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import (

"github.com/google/go-cmp/cmp"
tfjson "github.com/hashicorp/terraform-json"
"github.com/hashicorp/terraform-plugin-docs/schemamd"

"github.com/hashicorp/terraform-plugin-docs/internal/schemamd"
)

func TestRender(t *testing.T) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
tfjson "github.com/hashicorp/terraform-json"
"github.com/zclconf/go-cty/cty"

"github.com/hashicorp/terraform-plugin-docs/schemamd"
"github.com/hashicorp/terraform-plugin-docs/internal/schemamd"
)

func TestWriteAttributeDescription(t *testing.T) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import (

"github.com/google/go-cmp/cmp"
tfjson "github.com/hashicorp/terraform-json"
"github.com/hashicorp/terraform-plugin-docs/schemamd"

"github.com/hashicorp/terraform-plugin-docs/internal/schemamd"
)

func TestWriteBlockTypeDescription(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (

"github.com/google/go-cmp/cmp"
tfjson "github.com/hashicorp/terraform-json"
"github.com/hashicorp/terraform-plugin-docs/schemamd"
"github.com/zclconf/go-cty/cty"

"github.com/hashicorp/terraform-plugin-docs/internal/schemamd"
)

func TestWriteNestedAttributeTypeDescription(t *testing.T) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/zclconf/go-cty/cty"

"github.com/hashicorp/terraform-plugin-docs/schemamd"
"github.com/hashicorp/terraform-plugin-docs/internal/schemamd"
)

func TestWriteType(t *testing.T) {
Expand Down

0 comments on commit a1b156e

Please sign in to comment.