Skip to content

Commit

Permalink
Remove metalinter, slightly rework build+test rule (#12259)
Browse files Browse the repository at this point in the history
  • Loading branch information
rileykarson authored Aug 5, 2022
1 parent 9400c01 commit 766f86a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ jobs:

- name: Get dependencies
run: |
go get
make tools
go mod download
- name: Build
run: go build
run: |
make lint
make generate
go build
- name: Test
run: |
Expand Down
22 changes: 8 additions & 14 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ DIR_NAME=google

default: build

build: fmtcheck generate
build: lint generate
go install

test: fmtcheck generate
test: lint generate
go test $(TESTARGS) -timeout=30s $(TEST)

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

fmt:
Expand All @@ -20,18 +20,12 @@ fmt:

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

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

tools:
@echo "==> installing required tooling..."
go install github.com/client9/misspell/cmd/misspell@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
vet:
go vet

lint: fmtcheck vet

generate:
go generate ./...
Expand All @@ -54,4 +48,4 @@ endif
docscheck:
@sh -c "'$(CURDIR)/scripts/docscheck.sh'"

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

0 comments on commit 766f86a

Please sign in to comment.