Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-swinkler committed Oct 25, 2023
1 parent c1714c8 commit bbef44a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 38 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/acc-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,3 @@ jobs:
- name: Create and populate .snowflake/config file
run: mkdir $HOME/.snowflake && echo "${{ secrets.SNOWFLAKE_CONFIG_FILE }}" > $HOME/.snowflake/config
- run: make testacc
env:
SKIP_EMAIL_INTEGRATION_TESTS=true
SKIP_EXTERNAL_TABLE_TEST=true
SKIP_NOTIFICATION_INTEGRATION_TESTS=true
SKIP_SAML_INTEGRATION_TESTS=true
SKIP_STREAM_TEST=true
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
2. Ensure that your `GOPATH` is set to the desired location
3. Fork this repo and clone it into `$GOPATH/src/github.com/Snowflake-Labs/terraform-provider-snowflake`
4. cd to `terraform-provider-snowflake` and install all the required packages with `go get`
5. Build provider with `make build`
5. Build and install provider with `make install`

## Testing

Expand Down
61 changes: 30 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
export SKIP_EMAIL_INTEGRATION_TESTS=true
export SKIP_EXTERNAL_TABLE_TEST=true
export SKIP_NOTIFICATION_INTEGRATION_TESTS=true
export SKIP_SAML_INTEGRATION_TESTS=true
export SKIP_STREAM_TEST=true

default: install

build:
go build -v ./...

clean-generator-poc:
rm -f ./internal/sdk/poc/example/*_gen.go
rm -f ./internal/sdk/poc/example/*_gen_test.go

clean-generator-%: ## Clean generated files for specified resource
rm -f ./internal/sdk/$**_gen.go
rm -f ./internal/sdk/$**_gen_*test.go
default: help

docs:
go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate

docs-check: docs ## check that docs have been generated
git diff --exit-code -- docs
.PHONY: docs-check

fmt: ## Run gofumpt
@echo "==> Fixing source code with gofumpt..."
Expand All @@ -29,16 +22,10 @@ fumpt: fmt
generate:
cd tools && go generate ./...

generate-all-dto: ## Generate all DTOs for SDK interfaces
go generate ./internal/sdk/*_dto.go

generate-dto-%: ./internal/sdk/%_dto.go ## Generate DTO for given SDK interface
go generate $<

help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-23s\033[0m %s\n", $$1, $$2}'

install: build
install:
go install -v ./...

# See https://golangci-lint.run/
Expand All @@ -57,16 +44,6 @@ mod-check: mod ## check if there are any missing/unused modules
pre-push: fmt lint mod docs ## Run a few checks before pushing a change (docs, fmt, mod, etc.)

pre-push-check: docs-check lint-check mod-check; ## Run a few checks before pushing a change (docs, fmt, mod, etc.)
.PHONY: pre-push


run-generator-poc:
go generate ./internal/sdk/poc/example/*_def.go
go generate ./internal/sdk/poc/example/*_dto_gen.go

run-generator-%: ./internal/sdk/%_def.go ## Run go generate on given object definition
go generate $<
go generate ./internal/sdk/$*_dto_gen.go

sweep: ## destroy the whole architecture; USE ONLY FOR DEVELOPMENT ACCOUNTS
@echo "WARNING: This will destroy infrastructure. Use only in development accounts."
Expand All @@ -81,12 +58,34 @@ test:
go test -v -cover -timeout=30m -parallel=4 ./...

testacc:
TF_ACC=1 go test -v -cover -timeout 30m -parallel=4 `go list ./... | grep -v internal/sdk`
TF_ACC=1 go test -v -cover -timeout 30m -parallel=4 `go list ./... | grep -v pkg/sdk`

tools:
cd tools && go install github.com/golangci/golangci-lint/cmd/golangci-lint
cd tools && go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
cd tools && go install github.com/hashicorp/copywrite
cd tools && go install mvdan.cc/gofumpt

generate-all-dto: ## Generate all DTOs for SDK interfaces
go generate ./internal/sdk/*_dto.go

generate-dto-%: ./internal/sdk/%_dto.go ## Generate DTO for given SDK interface
go generate $<

clean-generator-poc:
rm -f ./internal/sdk/poc/example/*_gen.go
rm -f ./internal/sdk/poc/example/*_gen_test.go

clean-generator-%: ## Clean generated files for specified resource
rm -f ./internal/sdk/$**_gen.go
rm -f ./internal/sdk/$**_gen_*test.go

run-generator-poc:
go generate ./internal/sdk/poc/example/*_def.go
go generate ./internal/sdk/poc/example/*_dto_gen.go

run-generator-%: ./internal/sdk/%_def.go ## Run go generate on given object definition
go generate $<
go generate ./internal/sdk/$*_dto_gen.go

.PHONY: build clean-generator-poc clean-generator-% docs docs-check fmt fumpt generate generate-all-dto generate-dto-% help install lint lint-fix mod mod-check pre-push pre-push-check run-generator-poc run-generator-% sweep test testacc tools
2 changes: 2 additions & 0 deletions pkg/sdk/tasks_dto_builders_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bbef44a

Please sign in to comment.