From 4d799ab30f2c8c334ec33bb85310fdb7a57a681a Mon Sep 17 00:00:00 2001 From: sebhcp Date: Mon, 25 Jul 2022 10:32:15 -0500 Subject: [PATCH 1/5] normalize [dir] to [DIR] --- internal/command/providers.go | 2 +- website/docs/cli/commands/0.12upgrade.mdx | 2 +- website/docs/cli/commands/0.13upgrade.mdx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/command/providers.go b/internal/command/providers.go index 5bc0d4e6c3..25514f542d 100644 --- a/internal/command/providers.go +++ b/internal/command/providers.go @@ -149,7 +149,7 @@ func (c *ProvidersCommand) populateTreeNode(tree treeprint.Tree, node *configs.M } const providersCommandHelp = ` -Usage: terraform [global options] providers [dir] +Usage: terraform [global options] providers [DIR] Prints out a tree of modules in the referenced configuration annotated with their provider requirements. diff --git a/website/docs/cli/commands/0.12upgrade.mdx b/website/docs/cli/commands/0.12upgrade.mdx index 73068ad71b..6b9de3d027 100644 --- a/website/docs/cli/commands/0.12upgrade.mdx +++ b/website/docs/cli/commands/0.12upgrade.mdx @@ -15,7 +15,7 @@ with Terraform v0.12. ## Usage -Usage: `terraform 0.12upgrade [options] [dir]` +Usage: `terraform 0.12upgrade [options] [DIR]` By default, `0.12upgrade` changes configuration files in the current working directory. However, you can provide an explicit path to another directory if diff --git a/website/docs/cli/commands/0.13upgrade.mdx b/website/docs/cli/commands/0.13upgrade.mdx index 7322129aa9..49ffd45ae8 100644 --- a/website/docs/cli/commands/0.13upgrade.mdx +++ b/website/docs/cli/commands/0.13upgrade.mdx @@ -15,7 +15,7 @@ provider source settings are stored in a `required_providers` block. ## Usage -Usage: `terraform 0.13upgrade [options] [dir]` +Usage: `terraform 0.13upgrade [options] [DIR]` The primary purpose of the `0.13upgrade` command is to determine which providers are in use for a module, detect the source address for those From 31d6a1c186057e0b6bdf0979ae080792a967a556 Mon Sep 17 00:00:00 2001 From: sebhcp Date: Mon, 25 Jul 2022 10:44:58 -0500 Subject: [PATCH 2/5] revert changes for upgrade.mdx --- website/docs/cli/commands/0.12upgrade.mdx | 2 +- website/docs/cli/commands/0.13upgrade.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/cli/commands/0.12upgrade.mdx b/website/docs/cli/commands/0.12upgrade.mdx index 6b9de3d027..73068ad71b 100644 --- a/website/docs/cli/commands/0.12upgrade.mdx +++ b/website/docs/cli/commands/0.12upgrade.mdx @@ -15,7 +15,7 @@ with Terraform v0.12. ## Usage -Usage: `terraform 0.12upgrade [options] [DIR]` +Usage: `terraform 0.12upgrade [options] [dir]` By default, `0.12upgrade` changes configuration files in the current working directory. However, you can provide an explicit path to another directory if diff --git a/website/docs/cli/commands/0.13upgrade.mdx b/website/docs/cli/commands/0.13upgrade.mdx index 49ffd45ae8..7322129aa9 100644 --- a/website/docs/cli/commands/0.13upgrade.mdx +++ b/website/docs/cli/commands/0.13upgrade.mdx @@ -15,7 +15,7 @@ provider source settings are stored in a `required_providers` block. ## Usage -Usage: `terraform 0.13upgrade [options] [DIR]` +Usage: `terraform 0.13upgrade [options] [dir]` The primary purpose of the `0.13upgrade` command is to determine which providers are in use for a module, detect the source address for those From 301174a3dfb495875c4047455fcb746d249d3c45 Mon Sep 17 00:00:00 2001 From: sebhcp Date: Mon, 1 Aug 2022 16:16:33 -0500 Subject: [PATCH 3/5] run goimports --- internal/backend/remote-state/oss/backend.go | 3 ++- internal/backend/remote/backend_context_test.go | 5 +++-- internal/command/command_test.go | 3 ++- internal/command/views/show.go | 1 + internal/plans/internal/planproto/planfile.pb.go | 5 +++-- internal/registry/regsrc/friendly_host.go | 2 -- internal/tfplugin5/tfplugin5.pb.go | 5 +++-- internal/tfplugin6/tfplugin6.pb.go | 5 +++-- 8 files changed, 17 insertions(+), 12 deletions(-) diff --git a/internal/backend/remote-state/oss/backend.go b/internal/backend/remote-state/oss/backend.go index 2d488ce14c..a19589b57d 100644 --- a/internal/backend/remote-state/oss/backend.go +++ b/internal/backend/remote-state/oss/backend.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints" "io/ioutil" "log" "net/http" @@ -16,6 +15,8 @@ import ( "strings" "time" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" diff --git a/internal/backend/remote/backend_context_test.go b/internal/backend/remote/backend_context_test.go index f3a133421a..c85a45154d 100644 --- a/internal/backend/remote/backend_context_test.go +++ b/internal/backend/remote/backend_context_test.go @@ -2,11 +2,12 @@ package remote import ( "context" - "github.com/hashicorp/terraform/internal/terraform" - "github.com/hashicorp/terraform/internal/tfdiags" "reflect" "testing" + "github.com/hashicorp/terraform/internal/terraform" + "github.com/hashicorp/terraform/internal/tfdiags" + tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform/internal/backend" "github.com/hashicorp/terraform/internal/command/arguments" diff --git a/internal/command/command_test.go b/internal/command/command_test.go index 7fb593d4a0..5b992d4115 100644 --- a/internal/command/command_test.go +++ b/internal/command/command_test.go @@ -7,7 +7,6 @@ import ( "encoding/base64" "encoding/json" "fmt" - "github.com/google/go-cmp/cmp" "io" "io/ioutil" "net/http" @@ -20,6 +19,8 @@ import ( "syscall" "testing" + "github.com/google/go-cmp/cmp" + svchost "github.com/hashicorp/terraform-svchost" "github.com/hashicorp/terraform-svchost/disco" "github.com/hashicorp/terraform/internal/addrs" diff --git a/internal/command/views/show.go b/internal/command/views/show.go index 1ab16c2d51..906c96a670 100644 --- a/internal/command/views/show.go +++ b/internal/command/views/show.go @@ -2,6 +2,7 @@ package views import ( "fmt" + "github.com/hashicorp/terraform/internal/command/arguments" "github.com/hashicorp/terraform/internal/command/format" "github.com/hashicorp/terraform/internal/command/jsonplan" diff --git a/internal/plans/internal/planproto/planfile.pb.go b/internal/plans/internal/planproto/planfile.pb.go index 93b328d39d..f08bd11435 100644 --- a/internal/plans/internal/planproto/planfile.pb.go +++ b/internal/plans/internal/planproto/planfile.pb.go @@ -7,10 +7,11 @@ package planproto import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/internal/registry/regsrc/friendly_host.go b/internal/registry/regsrc/friendly_host.go index c9bc40bee8..22a8d6d4d4 100644 --- a/internal/registry/regsrc/friendly_host.go +++ b/internal/registry/regsrc/friendly_host.go @@ -3,8 +3,6 @@ package regsrc import ( "regexp" "strings" - - "github.com/hashicorp/terraform-svchost" ) var ( diff --git a/internal/tfplugin5/tfplugin5.pb.go b/internal/tfplugin5/tfplugin5.pb.go index ba7fb7b47b..133adf6b92 100644 --- a/internal/tfplugin5/tfplugin5.pb.go +++ b/internal/tfplugin5/tfplugin5.pb.go @@ -27,13 +27,14 @@ package tfplugin5 import ( context "context" + reflect "reflect" + sync "sync" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/internal/tfplugin6/tfplugin6.pb.go b/internal/tfplugin6/tfplugin6.pb.go index 416e007b89..1a04886546 100644 --- a/internal/tfplugin6/tfplugin6.pb.go +++ b/internal/tfplugin6/tfplugin6.pb.go @@ -27,13 +27,14 @@ package tfplugin6 import ( context "context" + reflect "reflect" + sync "sync" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( From e029e7b699943041741778cfba359664e8bab7d1 Mon Sep 17 00:00:00 2001 From: sebhcp Date: Mon, 1 Aug 2022 16:26:26 -0500 Subject: [PATCH 4/5] revert "run goimports" This reverts commit 301174a3dfb495875c4047455fcb746d249d3c45. --- internal/backend/remote-state/oss/backend.go | 3 +-- internal/backend/remote/backend_context_test.go | 5 ++--- internal/command/command_test.go | 3 +-- internal/command/views/show.go | 1 - internal/plans/internal/planproto/planfile.pb.go | 5 ++--- internal/registry/regsrc/friendly_host.go | 2 ++ internal/tfplugin5/tfplugin5.pb.go | 5 ++--- internal/tfplugin6/tfplugin6.pb.go | 5 ++--- 8 files changed, 12 insertions(+), 17 deletions(-) diff --git a/internal/backend/remote-state/oss/backend.go b/internal/backend/remote-state/oss/backend.go index a19589b57d..2d488ce14c 100644 --- a/internal/backend/remote-state/oss/backend.go +++ b/internal/backend/remote-state/oss/backend.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "fmt" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints" "io/ioutil" "log" "net/http" @@ -15,8 +16,6 @@ import ( "strings" "time" - "github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints" - "github.com/aliyun/alibaba-cloud-sdk-go/sdk" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" diff --git a/internal/backend/remote/backend_context_test.go b/internal/backend/remote/backend_context_test.go index c85a45154d..f3a133421a 100644 --- a/internal/backend/remote/backend_context_test.go +++ b/internal/backend/remote/backend_context_test.go @@ -2,11 +2,10 @@ package remote import ( "context" - "reflect" - "testing" - "github.com/hashicorp/terraform/internal/terraform" "github.com/hashicorp/terraform/internal/tfdiags" + "reflect" + "testing" tfe "github.com/hashicorp/go-tfe" "github.com/hashicorp/terraform/internal/backend" diff --git a/internal/command/command_test.go b/internal/command/command_test.go index 5b992d4115..7fb593d4a0 100644 --- a/internal/command/command_test.go +++ b/internal/command/command_test.go @@ -7,6 +7,7 @@ import ( "encoding/base64" "encoding/json" "fmt" + "github.com/google/go-cmp/cmp" "io" "io/ioutil" "net/http" @@ -19,8 +20,6 @@ import ( "syscall" "testing" - "github.com/google/go-cmp/cmp" - svchost "github.com/hashicorp/terraform-svchost" "github.com/hashicorp/terraform-svchost/disco" "github.com/hashicorp/terraform/internal/addrs" diff --git a/internal/command/views/show.go b/internal/command/views/show.go index 906c96a670..1ab16c2d51 100644 --- a/internal/command/views/show.go +++ b/internal/command/views/show.go @@ -2,7 +2,6 @@ package views import ( "fmt" - "github.com/hashicorp/terraform/internal/command/arguments" "github.com/hashicorp/terraform/internal/command/format" "github.com/hashicorp/terraform/internal/command/jsonplan" diff --git a/internal/plans/internal/planproto/planfile.pb.go b/internal/plans/internal/planproto/planfile.pb.go index f08bd11435..93b328d39d 100644 --- a/internal/plans/internal/planproto/planfile.pb.go +++ b/internal/plans/internal/planproto/planfile.pb.go @@ -7,11 +7,10 @@ package planproto import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/internal/registry/regsrc/friendly_host.go b/internal/registry/regsrc/friendly_host.go index 22a8d6d4d4..c9bc40bee8 100644 --- a/internal/registry/regsrc/friendly_host.go +++ b/internal/registry/regsrc/friendly_host.go @@ -3,6 +3,8 @@ package regsrc import ( "regexp" "strings" + + "github.com/hashicorp/terraform-svchost" ) var ( diff --git a/internal/tfplugin5/tfplugin5.pb.go b/internal/tfplugin5/tfplugin5.pb.go index 133adf6b92..ba7fb7b47b 100644 --- a/internal/tfplugin5/tfplugin5.pb.go +++ b/internal/tfplugin5/tfplugin5.pb.go @@ -27,14 +27,13 @@ package tfplugin5 import ( context "context" - reflect "reflect" - sync "sync" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/internal/tfplugin6/tfplugin6.pb.go b/internal/tfplugin6/tfplugin6.pb.go index 1a04886546..416e007b89 100644 --- a/internal/tfplugin6/tfplugin6.pb.go +++ b/internal/tfplugin6/tfplugin6.pb.go @@ -27,14 +27,13 @@ package tfplugin6 import ( context "context" - reflect "reflect" - sync "sync" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( From 1ad649c446bf52047ecc38e8e9572bd9e458b469 Mon Sep 17 00:00:00 2001 From: sebhcp Date: Mon, 1 Aug 2022 16:38:03 -0500 Subject: [PATCH 5/5] goimports on providers.go only --- internal/command/providers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/command/providers.go b/internal/command/providers.go index 25514f542d..c55a91774a 100644 --- a/internal/command/providers.go +++ b/internal/command/providers.go @@ -4,10 +4,11 @@ import ( "fmt" "path/filepath" + "github.com/xlab/treeprint" + "github.com/hashicorp/terraform/internal/configs" "github.com/hashicorp/terraform/internal/getproviders" "github.com/hashicorp/terraform/internal/tfdiags" - "github.com/xlab/treeprint" ) // ProvidersCommand is a Command implementation that prints out information