Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools Update #912

Merged
merged 8 commits into from
Feb 1, 2022
Merged
6 changes: 1 addition & 5 deletions .github/MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ Output from acceptance testing in Okta:

Almost exclusively, `github.com/okta/okta-sdk-go` updates are additive in nature. It is generally safe to only scan through them before approving and merging. If you have any concerns about any of the service client updates such as suspicious code removals in the update, or deprecations introduced, run the acceptance testing for potentially affected resources before merging.

##### golangci-lint Updates

Merge if CI passes.

##### Terraform Plugin SDK Updates

Except for trivial changes, run the full acceptance testing suite against the pull request and verify there are no new or unexpected failures.
Expand Down Expand Up @@ -112,4 +108,4 @@ Changes that should _not_ have a CHANGELOG entry:
- Run the HashiCorp (non-OSS) TeamCity release job with the `DEPLOYMENT_TARGET_VERSION` matching the expected release milestone and `DEPLOYMENT_NEXT_VERSION` matching the next release milestone
- Wait for the TeamCity release job and CircleCI website deployment jobs to complete either by watching the build logs or Slack notifications
- Close the release milestone
- Create a new GitHub release with the release title exactly matching the tag and milestone (e.g. `v2.22.0`) and copy the notes from the CHANGELOG to the release notes. This will trigger [HashiBot](https://github.com/apps/hashibot) release comments.
- Create a new GitHub release with the release title exactly matching the tag and milestone (e.g. `v2.22.0`) and copy the notes from the CHANGELOG to the release notes. This will trigger [HashiBot](https://github.com/apps/hashibot) release comments.
35 changes: 16 additions & 19 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
SWEEP?=global
TEST?=$$(go list ./... |grep -v 'vendor')
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
WEBSITE_REPO=github.com/hashicorp/terraform-website
PKG_NAME=okta
GOLINT=golangci-lint
GOFMT:=gofumpt
TFPROVIDERLINT=tfproviderlint
STATICCHECK=staticcheck

# Expression to match against tests
# go test -run <filter>
Expand All @@ -30,27 +29,21 @@ test: fmtcheck
go test -i $(TEST) || exit 1
echo $(TEST) | \
xargs -t -n4 go test $(TESTARGS) $(TEST_FILTER) -timeout=30s -parallel=4
test: fmtcheck

testacc: fmtcheck
TF_ACC=1 go test $(TEST) -v $(TESTARGS) $(TEST_FILTER) -timeout 120m

vet:
@echo "go vet ."
@go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
exit 1; \
fi
vet: tools
@echo "==> Checking source code against go vet and staticcheck"
@go vet ./...
@staticcheck ./...

.PHONY: fmt
fmt: tools # Format the code
@echo "formatting the code..."
@$(GOFMT) -l -w $$(find . -name '*.go' |grep -v vendor)
@echo "formatting the code with $(GOFMT)..."
@$(GOFMT) -l -w .

fmtcheck: dep
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
@gofumpt -d -l .

errcheck:
@sh -c "'$(CURDIR)/scripts/errcheck.sh'"
Expand All @@ -65,7 +58,6 @@ test-compile:

lint: tools
@echo "==> Checking source code against linters..."
@GOGC=30 $(GOLINT) run ./$(PKG_NAME)
@$(TFPROVIDERLINT) \
-c 1 \
-AT001 \
Expand All @@ -90,9 +82,14 @@ lint: tools
./$(PKG_NAME)

tools:
@which $(GOLINT) || curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.40.1
@which $(TFPROVIDERLINT) || go install github.com/bflad/tfproviderlint/cmd/tfproviderlint
@which $(GOFMT) || GO111MODULE=on go get mvdan.cc/gofumpt@v0.1.1
@which $(GOFMT) || go install mvdan.cc/gofumpt@v0.2.1
@which $(TFPROVIDERLINT) || go install github.com/bflad/tfproviderlint/cmd/tfproviderlint@v0.27.1
@which $(STATICCHECK) || go install honnef.co/go/tools/cmd/staticcheck@2021.1.2

tools-update:
@go install mvdan.cc/gofumpt@v0.2.1
@go install github.com/bflad/tfproviderlint/cmd/tfproviderlint@v0.27.1
@go install honnef.co/go/tools/cmd/staticcheck@2021.1.2

website:
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
Expand Down
13 changes: 0 additions & 13 deletions scripts/gofmtcheck.sh

This file was deleted.