From 1f28b7c00ba0faedb68415a81b6718edc4865e29 Mon Sep 17 00:00:00 2001 From: Selena Goods Date: Thu, 11 Apr 2024 15:58:23 -0400 Subject: [PATCH] Move `schemamd` and `functionmd` packages to `internal` (#354) * Move `schemamd` and `functionmd` packages to `internal` * Add changelog entries * Switch changelog entry kind to `Breaking Changes` --- .changes/unreleased/BREAKING CHANGES-20240410-161445.yaml | 6 ++++++ .changes/unreleased/BREAKING CHANGES-20240410-161540.yaml | 6 ++++++ {functionmd => internal/functionmd}/render.go | 2 +- {functionmd => internal/functionmd}/render_test.go | 2 +- .../functionmd}/testdata/example_arguments.md | 0 .../functionmd}/testdata/example_signature.md | 0 .../functionmd}/testdata/example_vararg.md | 0 .../functionmd}/testdata/function_signature.schema.json | 0 internal/provider/template.go | 5 +++-- {schemamd => internal/schemamd}/behaviors.go | 0 {schemamd => internal/schemamd}/behaviors_test.go | 0 {schemamd => internal/schemamd}/render.go | 0 {schemamd => internal/schemamd}/render_test.go | 3 ++- .../schemamd}/testdata/aws_acm_certificate.md | 0 .../schemamd}/testdata/aws_acm_certificate.schema.json | 0 .../schemamd}/testdata/aws_route_table_association.md | 0 .../testdata/aws_route_table_association.schema.json | 0 .../schemamd}/testdata/awscc_acmpca_certificate.md | 0 .../schemamd}/testdata/awscc_acmpca_certificate.schema.json | 0 .../schemamd}/testdata/awscc_logs_log_group.md | 0 .../schemamd}/testdata/awscc_logs_log_group.schema.json | 0 .../schemamd}/write_attribute_description.go | 0 .../schemamd}/write_attribute_description_test.go | 2 +- .../schemamd}/write_block_type_description.go | 0 .../schemamd}/write_block_type_description_test.go | 3 ++- .../schemamd}/write_nested_attribute_type_description.go | 0 .../write_nested_attribute_type_description_test.go | 3 ++- {schemamd => internal/schemamd}/write_type.go | 0 {schemamd => internal/schemamd}/write_type_test.go | 2 +- 29 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 .changes/unreleased/BREAKING CHANGES-20240410-161445.yaml create mode 100644 .changes/unreleased/BREAKING CHANGES-20240410-161540.yaml rename {functionmd => internal/functionmd}/render.go (97%) rename {functionmd => internal/functionmd}/render_test.go (97%) rename {functionmd => internal/functionmd}/testdata/example_arguments.md (100%) rename {functionmd => internal/functionmd}/testdata/example_signature.md (100%) rename {functionmd => internal/functionmd}/testdata/example_vararg.md (100%) rename {functionmd => internal/functionmd}/testdata/function_signature.schema.json (100%) rename {schemamd => internal/schemamd}/behaviors.go (100%) rename {schemamd => internal/schemamd}/behaviors_test.go (100%) rename {schemamd => internal/schemamd}/render.go (100%) rename {schemamd => internal/schemamd}/render_test.go (96%) rename {schemamd => internal/schemamd}/testdata/aws_acm_certificate.md (100%) rename {schemamd => internal/schemamd}/testdata/aws_acm_certificate.schema.json (100%) rename {schemamd => internal/schemamd}/testdata/aws_route_table_association.md (100%) rename {schemamd => internal/schemamd}/testdata/aws_route_table_association.schema.json (100%) rename {schemamd => internal/schemamd}/testdata/awscc_acmpca_certificate.md (100%) rename {schemamd => internal/schemamd}/testdata/awscc_acmpca_certificate.schema.json (100%) rename {schemamd => internal/schemamd}/testdata/awscc_logs_log_group.md (100%) rename {schemamd => internal/schemamd}/testdata/awscc_logs_log_group.schema.json (100%) rename {schemamd => internal/schemamd}/write_attribute_description.go (100%) rename {schemamd => internal/schemamd}/write_attribute_description_test.go (98%) rename {schemamd => internal/schemamd}/write_block_type_description.go (100%) rename {schemamd => internal/schemamd}/write_block_type_description_test.go (98%) rename {schemamd => internal/schemamd}/write_nested_attribute_type_description.go (100%) rename {schemamd => internal/schemamd}/write_nested_attribute_type_description_test.go (97%) rename {schemamd => internal/schemamd}/write_type.go (100%) rename {schemamd => internal/schemamd}/write_type_test.go (95%) diff --git a/.changes/unreleased/BREAKING CHANGES-20240410-161445.yaml b/.changes/unreleased/BREAKING CHANGES-20240410-161445.yaml new file mode 100644 index 00000000..54257eb4 --- /dev/null +++ b/.changes/unreleased/BREAKING CHANGES-20240410-161445.yaml @@ -0,0 +1,6 @@ +kind: BREAKING CHANGES +body: 'schemamd: The `schemamd` package has moved to `internal/schemamd` and can no + longer be imported' +time: 2024-04-10T16:14:45.685307-04:00 +custom: + Issue: "354" diff --git a/.changes/unreleased/BREAKING CHANGES-20240410-161540.yaml b/.changes/unreleased/BREAKING CHANGES-20240410-161540.yaml new file mode 100644 index 00000000..bd67abfe --- /dev/null +++ b/.changes/unreleased/BREAKING CHANGES-20240410-161540.yaml @@ -0,0 +1,6 @@ +kind: BREAKING CHANGES +body: 'functionmd: The `functionmd` package has moved to `internal/functionmd` and + can no longer be imported' +time: 2024-04-10T16:15:40.388578-04:00 +custom: + Issue: "354" diff --git a/functionmd/render.go b/internal/functionmd/render.go similarity index 97% rename from functionmd/render.go rename to internal/functionmd/render.go index fdea3a82..7b4951b7 100644 --- a/functionmd/render.go +++ b/internal/functionmd/render.go @@ -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. diff --git a/functionmd/render_test.go b/internal/functionmd/render_test.go similarity index 97% rename from functionmd/render_test.go rename to internal/functionmd/render_test.go index c76c37a7..dbc8e5cf 100644 --- a/functionmd/render_test.go +++ b/internal/functionmd/render_test.go @@ -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) { diff --git a/functionmd/testdata/example_arguments.md b/internal/functionmd/testdata/example_arguments.md similarity index 100% rename from functionmd/testdata/example_arguments.md rename to internal/functionmd/testdata/example_arguments.md diff --git a/functionmd/testdata/example_signature.md b/internal/functionmd/testdata/example_signature.md similarity index 100% rename from functionmd/testdata/example_signature.md rename to internal/functionmd/testdata/example_signature.md diff --git a/functionmd/testdata/example_vararg.md b/internal/functionmd/testdata/example_vararg.md similarity index 100% rename from functionmd/testdata/example_vararg.md rename to internal/functionmd/testdata/example_vararg.md diff --git a/functionmd/testdata/function_signature.schema.json b/internal/functionmd/testdata/function_signature.schema.json similarity index 100% rename from functionmd/testdata/function_signature.schema.json rename to internal/functionmd/testdata/function_signature.schema.json diff --git a/internal/provider/template.go b/internal/provider/template.go index 10f2e655..58766489 100644 --- a/internal/provider/template.go +++ b/internal/provider/template.go @@ -16,10 +16,11 @@ import ( tfjson "github.com/hashicorp/terraform-json" - "github.com/hashicorp/terraform-plugin-docs/functionmd" + "github.com/hashicorp/terraform-plugin-docs/internal/schemamd" + + "github.com/hashicorp/terraform-plugin-docs/internal/functionmd" "github.com/hashicorp/terraform-plugin-docs/internal/mdplain" "github.com/hashicorp/terraform-plugin-docs/internal/tmplfuncs" - "github.com/hashicorp/terraform-plugin-docs/schemamd" ) const ( diff --git a/schemamd/behaviors.go b/internal/schemamd/behaviors.go similarity index 100% rename from schemamd/behaviors.go rename to internal/schemamd/behaviors.go diff --git a/schemamd/behaviors_test.go b/internal/schemamd/behaviors_test.go similarity index 100% rename from schemamd/behaviors_test.go rename to internal/schemamd/behaviors_test.go diff --git a/schemamd/render.go b/internal/schemamd/render.go similarity index 100% rename from schemamd/render.go rename to internal/schemamd/render.go diff --git a/schemamd/render_test.go b/internal/schemamd/render_test.go similarity index 96% rename from schemamd/render_test.go rename to internal/schemamd/render_test.go index 447826db..6d46ecd4 100644 --- a/schemamd/render_test.go +++ b/internal/schemamd/render_test.go @@ -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) { diff --git a/schemamd/testdata/aws_acm_certificate.md b/internal/schemamd/testdata/aws_acm_certificate.md similarity index 100% rename from schemamd/testdata/aws_acm_certificate.md rename to internal/schemamd/testdata/aws_acm_certificate.md diff --git a/schemamd/testdata/aws_acm_certificate.schema.json b/internal/schemamd/testdata/aws_acm_certificate.schema.json similarity index 100% rename from schemamd/testdata/aws_acm_certificate.schema.json rename to internal/schemamd/testdata/aws_acm_certificate.schema.json diff --git a/schemamd/testdata/aws_route_table_association.md b/internal/schemamd/testdata/aws_route_table_association.md similarity index 100% rename from schemamd/testdata/aws_route_table_association.md rename to internal/schemamd/testdata/aws_route_table_association.md diff --git a/schemamd/testdata/aws_route_table_association.schema.json b/internal/schemamd/testdata/aws_route_table_association.schema.json similarity index 100% rename from schemamd/testdata/aws_route_table_association.schema.json rename to internal/schemamd/testdata/aws_route_table_association.schema.json diff --git a/schemamd/testdata/awscc_acmpca_certificate.md b/internal/schemamd/testdata/awscc_acmpca_certificate.md similarity index 100% rename from schemamd/testdata/awscc_acmpca_certificate.md rename to internal/schemamd/testdata/awscc_acmpca_certificate.md diff --git a/schemamd/testdata/awscc_acmpca_certificate.schema.json b/internal/schemamd/testdata/awscc_acmpca_certificate.schema.json similarity index 100% rename from schemamd/testdata/awscc_acmpca_certificate.schema.json rename to internal/schemamd/testdata/awscc_acmpca_certificate.schema.json diff --git a/schemamd/testdata/awscc_logs_log_group.md b/internal/schemamd/testdata/awscc_logs_log_group.md similarity index 100% rename from schemamd/testdata/awscc_logs_log_group.md rename to internal/schemamd/testdata/awscc_logs_log_group.md diff --git a/schemamd/testdata/awscc_logs_log_group.schema.json b/internal/schemamd/testdata/awscc_logs_log_group.schema.json similarity index 100% rename from schemamd/testdata/awscc_logs_log_group.schema.json rename to internal/schemamd/testdata/awscc_logs_log_group.schema.json diff --git a/schemamd/write_attribute_description.go b/internal/schemamd/write_attribute_description.go similarity index 100% rename from schemamd/write_attribute_description.go rename to internal/schemamd/write_attribute_description.go diff --git a/schemamd/write_attribute_description_test.go b/internal/schemamd/write_attribute_description_test.go similarity index 98% rename from schemamd/write_attribute_description_test.go rename to internal/schemamd/write_attribute_description_test.go index dc2724af..c1318425 100644 --- a/schemamd/write_attribute_description_test.go +++ b/internal/schemamd/write_attribute_description_test.go @@ -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) { diff --git a/schemamd/write_block_type_description.go b/internal/schemamd/write_block_type_description.go similarity index 100% rename from schemamd/write_block_type_description.go rename to internal/schemamd/write_block_type_description.go diff --git a/schemamd/write_block_type_description_test.go b/internal/schemamd/write_block_type_description_test.go similarity index 98% rename from schemamd/write_block_type_description_test.go rename to internal/schemamd/write_block_type_description_test.go index 16183303..0ee14a26 100644 --- a/schemamd/write_block_type_description_test.go +++ b/internal/schemamd/write_block_type_description_test.go @@ -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) { diff --git a/schemamd/write_nested_attribute_type_description.go b/internal/schemamd/write_nested_attribute_type_description.go similarity index 100% rename from schemamd/write_nested_attribute_type_description.go rename to internal/schemamd/write_nested_attribute_type_description.go diff --git a/schemamd/write_nested_attribute_type_description_test.go b/internal/schemamd/write_nested_attribute_type_description_test.go similarity index 97% rename from schemamd/write_nested_attribute_type_description_test.go rename to internal/schemamd/write_nested_attribute_type_description_test.go index c576f2df..170284c1 100644 --- a/schemamd/write_nested_attribute_type_description_test.go +++ b/internal/schemamd/write_nested_attribute_type_description_test.go @@ -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) { diff --git a/schemamd/write_type.go b/internal/schemamd/write_type.go similarity index 100% rename from schemamd/write_type.go rename to internal/schemamd/write_type.go diff --git a/schemamd/write_type_test.go b/internal/schemamd/write_type_test.go similarity index 95% rename from schemamd/write_type_test.go rename to internal/schemamd/write_type_test.go index 2256b370..3def2586 100644 --- a/schemamd/write_type_test.go +++ b/internal/schemamd/write_type_test.go @@ -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) {