Skip to content

Commit

Permalink
tfproviderlint has been fixed bflad/tfproviderlint#255
Browse files Browse the repository at this point in the history
  • Loading branch information
karencfv committed Apr 27, 2023
1 parent d06c6b1 commit 4e4bf1d
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 25 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 8 additions & 10 deletions Makefile.tools
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion oxide/data_source_images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion oxide/data_source_projects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
4 changes: 2 additions & 2 deletions oxide/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
)
}
Expand All @@ -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.",
)
}
Expand Down
3 changes: 3 additions & 0 deletions oxide/resource_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion oxide/resource_disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion oxide/resource_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion oxide/resource_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion oxide/resource_ip_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion oxide/resource_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion oxide/resource_vpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 4e4bf1d

Please sign in to comment.