diff --git a/Makefile b/Makefile index dd232c3..82cc327 100644 --- a/Makefile +++ b/Makefile @@ -39,14 +39,14 @@ install: build ## Lints all of the source files .PHONY: lint -lint: golint golangci-lint tfproviderdocs terrafmt # configfmt tfproviderlint +lint: golint golangci-lint tfproviderdocs terrafmt tfproviderlint # configfmt # tf providerlint currently has a bug with the latest stable go version (1.18), will uncomment # when this issue is solved https://github.com/bflad/tfproviderlint/issues/255 -# .PHONY: tfproviderlint -# tfproviderlint: tools -# @ echo "-> Checking source code against terraform provider linters..." -# @ $(GOBIN)/tfproviderlint ./... +.PHONY: tfproviderlint +tfproviderlint: tools + @ echo "-> Checking source code against terraform provider linters..." + @ $(GOBIN)/tfproviderlint ./... .PHONY: tfproviderdocs tfproviderdocs: tools diff --git a/Makefile.tools b/Makefile.tools index 67dd216..5dc04a2 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -5,11 +5,9 @@ VERSION_GOLINT:=v0.0.0-20210508222113-6edffad5e616 VERSION_GOLANGCILINT:=v1.52.2 VERSION_TFPROVIDERDOCS:=v0.9.1 VERSION_TERRAFMT:=v0.5.2 -VERSION_TFPROVIDERLINT:=v0.28.1 +VERSION_TFPROVIDERLINT:=v0.29.0 -tools: $(GOBIN)/golint $(GOBIN)/golangci-lint $(GOBIN)/tfproviderdocs $(GOBIN)/terrafmt -# tfproviderlint currently has a bug https://github.com/bflad/tfproviderlint/issues/255 will uncomment when resolved. -# $(GOBIN)/tfproviderlint +tools: $(GOBIN)/golint $(GOBIN)/golangci-lint $(GOBIN)/tfproviderdocs $(GOBIN)/terrafmt $(GOBIN)/tfproviderlint $(GOBIN): @ mkdir -p $(GOBIN) @@ -49,10 +47,10 @@ $(GOBIN)/terrafmt: $(VERSION_DIR)/.version-terrafmt-$(VERSION_TERRAFMT) | $(GOBI @ echo "-> Installing terrafmt..." @ go install github.com/katbyte/terrafmt@$(VERSION_TERRAFMT) -# $(VERSION_DIR)/.version-tfproviderlint-$(VERSION_TFPROVIDERLINT): | $(VERSION_DIR) -# @ rm -f $(VERSION_DIR)/.version-tfproviderlint-* -# @ echo $(VERSION_TFPROVIDERLINT) > $(VERSION_DIR)/.version-tfproviderlint-$(VERSION_TFPROVIDERLINT) +$(VERSION_DIR)/.version-tfproviderlint-$(VERSION_TFPROVIDERLINT): | $(VERSION_DIR) + @ rm -f $(VERSION_DIR)/.version-tfproviderlint-* + @ echo $(VERSION_TFPROVIDERLINT) > $(VERSION_DIR)/.version-tfproviderlint-$(VERSION_TFPROVIDERLINT) -# $(GOBIN)/tfproviderlint: $(VERSION_DIR)/.version-tfproviderlint-$(VERSION_TFPROVIDERLINT) | $(GOBIN) -# @ echo "-> Installing tfproviderlint..." -# @ go install github.com/bflad/tfproviderlint/cmd/tfproviderlint@$(VERSION_TFPROVIDERLINT) +$(GOBIN)/tfproviderlint: $(VERSION_DIR)/.version-tfproviderlint-$(VERSION_TFPROVIDERLINT) | $(GOBIN) + @ echo "-> Installing tfproviderlint..." + @ go install github.com/bflad/tfproviderlint/cmd/tfproviderlint@$(VERSION_TFPROVIDERLINT) diff --git a/oxide/data_source_images_test.go b/oxide/data_source_images_test.go index 66de275..ad5a434 100644 --- a/oxide/data_source_images_test.go +++ b/oxide/data_source_images_test.go @@ -11,7 +11,7 @@ import ( ) // NB: The project must be populated with at least one image for this test to pass -func TestAccDataSourceImages(t *testing.T) { +func TestAccDataSourceImages_full(t *testing.T) { datasourceName := "data.oxide_images.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/oxide/data_source_projects_test.go b/oxide/data_source_projects_test.go index 980f36e..400658e 100644 --- a/oxide/data_source_projects_test.go +++ b/oxide/data_source_projects_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) -func TestAccDataSourceProjects(t *testing.T) { +func TestAccDataSourceProjects_full(t *testing.T) { datasourceName := "data.oxide_projects.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/oxide/provider.go b/oxide/provider.go index 528ba9a..c5e0dfb 100644 --- a/oxide/provider.go +++ b/oxide/provider.go @@ -80,7 +80,7 @@ func (p *oxideProvider) Configure(ctx context.Context, req provider.ConfigureReq resp.Diagnostics.AddError( "Missing API Token Configuration", "While configuring the provider, the API token was not found in "+ - "the OXIDE_TOKEN environment variable or provider "+ + "the OXIDE_TOKEN environment variable or "+ "configuration block token attribute.", ) } @@ -89,7 +89,7 @@ func (p *oxideProvider) Configure(ctx context.Context, req provider.ConfigureReq resp.Diagnostics.AddError( "Missing Host Configuration", "While configuring the provider, the host was not found in "+ - "the OXIDE_HOST environment variable or provider "+ + "the OXIDE_HOST environment variable or "+ "configuration block host attribute.", ) } diff --git a/oxide/resource_disk.go b/oxide/resource_disk.go index a53e5b8..8e89f8b 100644 --- a/oxide/resource_disk.go +++ b/oxide/resource_disk.go @@ -376,6 +376,9 @@ func waitForDetachedDisk(client *oxideSDK.Client, diskID oxideSDK.NameOrId, ch c if resp.State.State == "detached" { break } + + // Ignoring linting error for now as this entire function will be removed + //lintignore:R018 time.Sleep(time.Second) } ch <- nil diff --git a/oxide/resource_disk_test.go b/oxide/resource_disk_test.go index d603e4f..b62b022 100644 --- a/oxide/resource_disk_test.go +++ b/oxide/resource_disk_test.go @@ -13,7 +13,7 @@ import ( oxideSDK "github.com/oxidecomputer/oxide.go/oxide" ) -func TestAccResourceDisk(t *testing.T) { +func TestAccResourceDisk_full(t *testing.T) { resourceName := "oxide_disk.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/oxide/resource_image_test.go b/oxide/resource_image_test.go index 9b5d762..0e4e9a2 100644 --- a/oxide/resource_image_test.go +++ b/oxide/resource_image_test.go @@ -6,7 +6,7 @@ package oxide // TODO: Restore test when it is possible to delete a global image -// func TestAccResourceImage(t *testing.T) { +// func TestAccResourceImage_full(t *testing.T) { // resourceName := "oxide_image.test" // // resource.ParallelTest(t, resource.TestCase{ diff --git a/oxide/resource_instance_test.go b/oxide/resource_instance_test.go index 03dd0fd..d090593 100644 --- a/oxide/resource_instance_test.go +++ b/oxide/resource_instance_test.go @@ -13,7 +13,7 @@ import ( oxideSDK "github.com/oxidecomputer/oxide.go/oxide" ) -func TestAccResourceInstance(t *testing.T) { +func TestAccResourceInstance_full(t *testing.T) { resourceName := "oxide_instance.test" secondResourceName := "oxide_instance.test2" thirdResourceName := "oxide_instance.test3" diff --git a/oxide/resource_ip_pool_test.go b/oxide/resource_ip_pool_test.go index 22a0d20..ff9ac28 100644 --- a/oxide/resource_ip_pool_test.go +++ b/oxide/resource_ip_pool_test.go @@ -13,7 +13,7 @@ import ( "github.com/oxidecomputer/oxide.go/oxide" ) -func TestAccResourceIpPool(t *testing.T) { +func TestAccResourceIpPool_full(t *testing.T) { resourceName := "oxide_ip_pool.test" resourceName2 := "oxide_ip_pool.test2" diff --git a/oxide/resource_project_test.go b/oxide/resource_project_test.go index 9699b61..de6e780 100644 --- a/oxide/resource_project_test.go +++ b/oxide/resource_project_test.go @@ -13,7 +13,7 @@ import ( oxideSDK "github.com/oxidecomputer/oxide.go/oxide" ) -func TestAccResourceProject(t *testing.T) { +func TestAccResourceProject_full(t *testing.T) { resourceName := "oxide_project.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/oxide/resource_vpc_test.go b/oxide/resource_vpc_test.go index a88a6b4..ba006bf 100644 --- a/oxide/resource_vpc_test.go +++ b/oxide/resource_vpc_test.go @@ -13,7 +13,7 @@ import ( oxideSDK "github.com/oxidecomputer/oxide.go/oxide" ) -func TestAccResourceVPC(t *testing.T) { +func TestAccResourceVPC_full(t *testing.T) { resourceName := "oxide_vpc.test" resourceName2 := "oxide_vpc.test2"