From 7a68bb5e44cc66d14983939854daf450558e4c7f Mon Sep 17 00:00:00 2001 From: Murad Biashimov Date: Fri, 12 Jan 2024 14:14:38 +0100 Subject: [PATCH] chore(imports): improve regexp (#1531) --- Makefile | 2 +- internal/schemautil/database.go | 3 ++- internal/schemautil/service_user.go | 3 ++- internal/schemautil/wait.go | 3 ++- .../service/organization/organization_user_data_source.go | 3 +-- internal/sdkprovider/service/organization/sweep.go | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 10a1247aa..6bceb0482 100644 --- a/Makefile +++ b/Makefile @@ -135,7 +135,7 @@ fmt-test: $(TERRAFMT) # It has to be added to PATH as `sed` command, to replace default BSD sed. # See `brew info gnu-sed` for more details on how to add it to PATH. fmt-imports: - find . -type f -name '*.go' -exec sed -zi 's/(?<== `\s+)"\n\+\t"/"\n"/g' {} + + find . -type f -name '*.go' -exec sed -zi 's/"[\r\n\t]\+"/"\n"/g' {} + goimports -local "github.com/aiven/terraform-provider-aiven" -w . ################################################# diff --git a/internal/schemautil/database.go b/internal/schemautil/database.go index 30231a708..4267663b8 100644 --- a/internal/schemautil/database.go +++ b/internal/schemautil/database.go @@ -5,8 +5,9 @@ import ( "time" "github.com/aiven/aiven-go-client/v2" - "github.com/aiven/terraform-provider-aiven/internal/common" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/aiven/terraform-provider-aiven/internal/common" ) // DatabaseDeleteWaiter is used to wait for Database to be deleted. diff --git a/internal/schemautil/service_user.go b/internal/schemautil/service_user.go index 6e0c33887..cfcc65bc8 100644 --- a/internal/schemautil/service_user.go +++ b/internal/schemautil/service_user.go @@ -6,11 +6,12 @@ import ( "log" "github.com/aiven/aiven-go-client/v2" - "github.com/aiven/terraform-provider-aiven/internal/common" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/aiven/terraform-provider-aiven/internal/common" ) func ResourceServiceUserCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { diff --git a/internal/schemautil/wait.go b/internal/schemautil/wait.go index 81dd3347e..bf73a1d81 100644 --- a/internal/schemautil/wait.go +++ b/internal/schemautil/wait.go @@ -9,9 +9,10 @@ import ( "time" "github.com/aiven/aiven-go-client/v2" - "github.com/aiven/terraform-provider-aiven/internal/common" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/aiven/terraform-provider-aiven/internal/common" ) const ( diff --git a/internal/sdkprovider/service/organization/organization_user_data_source.go b/internal/sdkprovider/service/organization/organization_user_data_source.go index 1563625ba..e9465e6ac 100644 --- a/internal/sdkprovider/service/organization/organization_user_data_source.go +++ b/internal/sdkprovider/service/organization/organization_user_data_source.go @@ -3,11 +3,10 @@ package organization import ( "context" + "github.com/aiven/aiven-go-client/v2" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/aiven/aiven-go-client/v2" - "github.com/aiven/terraform-provider-aiven/internal/schemautil" "github.com/aiven/terraform-provider-aiven/internal/schemautil/userconfig" ) diff --git a/internal/sdkprovider/service/organization/sweep.go b/internal/sdkprovider/service/organization/sweep.go index 5e920b3cc..8daa4bf57 100644 --- a/internal/sdkprovider/service/organization/sweep.go +++ b/internal/sdkprovider/service/organization/sweep.go @@ -7,9 +7,9 @@ import ( "fmt" "strings" + "github.com/aiven/aiven-go-client/v2" "github.com/hashicorp/terraform-plugin-testing/helper/resource" - "github.com/aiven/aiven-go-client/v2" "github.com/aiven/terraform-provider-aiven/internal/common" "github.com/aiven/terraform-provider-aiven/internal/sweep" )