diff --git a/build/Makefile.lint b/build/Makefile.lint index e31be7e27..1fd98c551 100644 --- a/build/Makefile.lint +++ b/build/Makefile.lint @@ -4,9 +4,8 @@ lint: golangci-lint check-license tfproviderlint tfproviderdocs terrafmt fmt .PHONY: tfproviderlint tfproviderlint: tools - @ echo '-> Ignoring tfproviderlint until https://github.com/bflad/tfproviderlint/issues/255 is fixed...' - #@ echo "-> Checking source code against terraform provider linters..." - #@ $(GOBIN)/tfproviderlint ./... + @ echo "-> Checking source code against terraform provider linters..." + @ $(GOBIN)/tfproviderlint -v $$(go list ./... | grep -v '/gen/') .PHONY: tfproviderdocs tfproviderdocs: tools diff --git a/build/Makefile.tools b/build/Makefile.tools index 69ac3e95d..5b8fb4d68 100644 --- a/build/Makefile.tools +++ b/build/Makefile.tools @@ -1,7 +1,7 @@ VERSION_TFPROVIDERDOCS:=v0.6.0 VERSION_TERRAFMT:=v0.5.2 -VERSION_TFPROVIDERLINT:=v0.28.1 +VERSION_TFPROVIDERLINT:=v0.31.0 ## Installs the required static checks for terraform. tools: $(GOBIN)/tfproviderdocs $(GOBIN)/terrafmt $(GOBIN)/tfproviderlint $(GOBIN)/tfplugindocs diff --git a/ec/acc/deployment_ml_only_autoscale_test.go b/ec/acc/deployment_ml_only_autoscale_test.go index ed23cbf05..88995aef5 100644 --- a/ec/acc/deployment_ml_only_autoscale_test.go +++ b/ec/acc/deployment_ml_only_autoscale_test.go @@ -28,7 +28,7 @@ import ( // Machine Learning nodes can be auto-scaled exclusively, while the data tier remains being managed manually. // // This feature leverages `autoscaling_tier_override` parameter within the ML topology element of the API payload. -func TestAccDeploymentWithMLOnlyAutoscale(t *testing.T) { +func TestAcc_DeploymentWithMLOnlyAutoscale(t *testing.T) { resourceName := "ec_deployment.autoscale_ml" initialTfConfigWithMlAutoscale := "testdata/deployment_autoscale_ml.tf" diff --git a/ec/acc/elasticsearch_project_test.go b/ec/acc/elasticsearch_project_test.go index f01b6f69e..830073037 100644 --- a/ec/acc/elasticsearch_project_test.go +++ b/ec/acc/elasticsearch_project_test.go @@ -28,7 +28,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" ) -func TestAccElasticsearchProject(t *testing.T) { +func TestAcc_ElasticsearchProject(t *testing.T) { resId := "my_project" resourceName := fmt.Sprintf("ec_elasticsearch_project.%s", resId) randomName := prefix + acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) diff --git a/ec/acc/observability_project_test.go b/ec/acc/observability_project_test.go index de4bd0a5c..cad8e5cbb 100644 --- a/ec/acc/observability_project_test.go +++ b/ec/acc/observability_project_test.go @@ -29,7 +29,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" ) -func TestAccObservabilityProject(t *testing.T) { +func TestAcc_ObservabilityProject(t *testing.T) { resId := "my_project" resourceName := fmt.Sprintf("ec_observability_project.%s", resId) randomName := prefix + acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) @@ -114,7 +114,7 @@ resource ec_observability_project "%s" { `, id, name, region, alias) } -func TestAccObservabilityProjectTier(t *testing.T) { +func TestAcc_ObservabilityProjectTier(t *testing.T) { resId := "my_project" resourceName := fmt.Sprintf("ec_observability_project.%s", resId) newName := prefix + acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) diff --git a/ec/acc/security_project_test.go b/ec/acc/security_project_test.go index 3db2a90b8..06273e14e 100644 --- a/ec/acc/security_project_test.go +++ b/ec/acc/security_project_test.go @@ -28,7 +28,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/terraform" ) -func TestAccSecurityProject(t *testing.T) { +func TestAcc_SecurityProject(t *testing.T) { resId := "my_project" resourceName := fmt.Sprintf("ec_security_project.%s", resId) randomName := prefix + acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) @@ -87,7 +87,7 @@ func TestAccSecurityProject(t *testing.T) { }) } -func TestAccSecurityProjectWithAdminFeaturesAndProductTypes(t *testing.T) { +func TestAcc_SecurityProjectWithAdminFeaturesAndProductTypes(t *testing.T) { resId := "my_project" resourceName := fmt.Sprintf("ec_security_project.%s", resId) randomName := prefix + acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) diff --git a/ec/ecresource/projectresource/elasticsearch.go b/ec/ecresource/projectresource/elasticsearch.go index 0c528adf1..3b761b0cb 100644 --- a/ec/ecresource/projectresource/elasticsearch.go +++ b/ec/ecresource/projectresource/elasticsearch.go @@ -92,6 +92,7 @@ type sleeper interface { type realSleeper struct{} func (r realSleeper) Sleep(d time.Duration) { + //lintignore:R018 // Intentionally wrapped for testability time.Sleep(d) } diff --git a/ec/ecresource/trafficfilterassocresource/update.go b/ec/ecresource/trafficfilterassocresource/update.go index e99403fcf..d3f6d9b6a 100644 --- a/ec/ecresource/trafficfilterassocresource/update.go +++ b/ec/ecresource/trafficfilterassocresource/update.go @@ -24,5 +24,8 @@ import ( ) func (r Resource) Update(ctx context.Context, request resource.UpdateRequest, response *resource.UpdateResponse) { - panic("ec_deployment_traffic_filter_association resources can not be updated!") + response.Diagnostics.AddError( + "Update not supported", + "ec_deployment_traffic_filter_association resources can not be updated!", + ) }