diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea07520d9..753f5df7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,9 +37,9 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 with: - go-version-file: 'tools/go.mod' + go-version-file: 'go.mod' cache: true - cache-dependency-path: tools/go.sum + cache-dependency-path: go.sum - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3 with: terraform_wrapper: false diff --git a/.golangci.yaml b/.golangci.yaml index d6301eebb..895bb6f8d 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,5 +1,7 @@ version: "2" linters: + enable: + - misspell exclusions: generated: lax presets: diff --git a/Makefile b/Makefile index 9c61914d9..d29e66622 100644 --- a/Makefile +++ b/Makefile @@ -245,27 +245,16 @@ install: build ## Install built provider into the local terraform cache .PHONY: tools -tools: $(GOBIN) tools-golangci-lint ## Install useful tools for linting, docs generation and development - @ cd tools && go install github.com/client9/misspell/cmd/misspell - -.PHONY: tools-golangci-lint -tools-golangci-lint: ## Download golangci-lint locally if necessary. +tools: $(GOBIN) ## Download golangci-lint locally if necessary. @[[ -f $(GOBIN)/golangci-lint ]] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v2.2.1 - -.PHONY: misspell -misspell: - @ $(GOBIN)/misspell -error -source go ./internal/ - @ $(GOBIN)/misspell -error -source text ./templates/ - - .PHONY: golangci-lint golangci-lint: @ $(GOBIN)/golangci-lint run --max-same-issues=0 $(GOLANGCIFLAGS) ./internal/... .PHONY: lint -lint: setup misspell golangci-lint check-fmt check-docs ## Run lints to check the spelling and common go patterns +lint: setup golangci-lint check-fmt check-docs ## Run lints to check the spelling and common go patterns .PHONY: fmt fmt: ## Format code diff --git a/generated/kbapi/kibana.go b/generated/kbapi/kibana.go new file mode 100644 index 000000000..39b877c72 --- /dev/null +++ b/generated/kbapi/kibana.go @@ -0,0 +1,3 @@ +package kbapi + +//go:generate make clean all diff --git a/internal/elasticsearch/security/api_key/schema.go b/internal/elasticsearch/security/api_key/schema.go index f2d9923b6..74f688785 100644 --- a/internal/elasticsearch/security/api_key/schema.go +++ b/internal/elasticsearch/security/api_key/schema.go @@ -117,6 +117,6 @@ func (r *Resource) requiresReplaceIfUpdateNotSupported() planmodifier.String { resp.RequiresReplace = version != nil && version.LessThan(MinVersionWithUpdate) }, "Requires replace if the server does not support update", - "Requries replace if the server does not support update", + "Requires replace if the server does not support update", ) } diff --git a/tools/go.mod b/tools/go.mod deleted file mode 100644 index a7ebe0eb2..000000000 --- a/tools/go.mod +++ /dev/null @@ -1,7 +0,0 @@ -module github.com/elastic/terraform-provider-elasticstack/tools - -go 1.24.0 - -toolchain go1.24.4 - -require github.com/client9/misspell v0.3.4 diff --git a/tools/go.sum b/tools/go.sum deleted file mode 100644 index ee5948021..000000000 --- a/tools/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= diff --git a/tools/kbapi_gen.go b/tools/kbapi_gen.go deleted file mode 100644 index aa6b777a6..000000000 --- a/tools/kbapi_gen.go +++ /dev/null @@ -1,3 +0,0 @@ -package tools - -//go:generate make -C ../generated/kbapi clean all diff --git a/tools/tools.go b/tools/tools.go deleted file mode 100644 index 1718824c7..000000000 --- a/tools/tools.go +++ /dev/null @@ -1,8 +0,0 @@ -//go:build tools -// +build tools - -package tools - -import ( - _ "github.com/client9/misspell/cmd/misspell" -)