Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
em0ney committed Jun 4, 2019
0 parents commit ba0d765
Show file tree
Hide file tree
Showing 17 changed files with 1,314 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .gitignore
@@ -0,0 +1,33 @@
*.dll
*.exe
.DS_Store
example.tf
terraform.tfvars
terraform.tfplan
terraform.tfstate
bin/
terraform-provider-google
modules-dev/
/pkg/
website/.vagrant
website/.bundle
website/build
website/node_modules
.vagrant/
*.backup
./*.tfstate
.terraform/
*.log
*.bak
*~
.*.swp
.idea
*.iml
*.test
*.iml

website/vendor

# Test exclusions
!command/test-fixtures/**/*.tfstate
!command/test-fixtures/**/.terraform/
26 changes: 26 additions & 0 deletions .golangci.yml
@@ -0,0 +1,26 @@
issues:
max-per-linter: 0
max-same-issues: 0

linters:
disable-all: true
enable:
- deadcode
- errcheck
- gofmt
- gosimple
- ineffassign
- misspell
- staticcheck
- structcheck
- unconvert
- unused
- varcheck
- vet

linters-settings:
errcheck:
ignore: github.com/hashicorp/terraform/helper/schema:ForceNew|Set,fmt:.*,io:Close,github.com/terraform-providers/terraform-provider-gorillastack/gorillastack:Set

run:
modules-download-mode: vendor
60 changes: 60 additions & 0 deletions GNUmakefile
@@ -0,0 +1,60 @@
TEST?=$$(go list ./... | grep -v 'vendor')
WEBSITE_REPO=github.com/hashicorp/terraform-website
PKG_NAME=google

default: build

build: fmtcheck
go install

test: fmtcheck
go test -i $(TEST) || exit 1
echo $(TEST) | \
xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4

testacc: fmtcheck
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test $(TEST) -v $(TESTARGS) -timeout 240m -ldflags="-X=github.com/terraform-providers/terraform-provider-google/version.ProviderVersion=acc"

fmt:
@echo "==> Fixing source code with gofmt..."
gofmt -w -s ./$(PKG_NAME)

# Currently required by tf-deploy compile
fmtcheck:
@echo "==> Checking source code against gofmt..."
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"

lint:
@echo "==> Checking source code against linters..."
@golangci-lint run ./$(PKG_NAME)

tools:
@echo "==> installing required tooling..."
GO111MODULE=off go get -u github.com/client9/misspell/cmd/misspell
GO111MODULE=off go get -u github.com/golangci/golangci-lint/cmd/golangci-lint


test-compile:
@if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package. For example,"; \
echo " make test-compile TEST=./$(PKG_NAME)"; \
exit 1; \
fi
go test -c $(TEST) $(TESTARGS)

website:
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)

website-test:
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)

.PHONY: build test testacc vet fmt fmtcheck lint tools errcheck test-compile website website-test

0 comments on commit ba0d765

Please sign in to comment.