Skip to content

Commit

Permalink
remove golines
Browse files Browse the repository at this point in the history
  • Loading branch information
vandyliu committed Apr 3, 2024
1 parent c3f9b80 commit 0f954f2
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 19 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions:
jobs:
# Ensure project builds before running testing matrix
build:
name: Build
name: Build and unit test
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
Expand All @@ -27,12 +27,21 @@ jobs:
with:
go-version-file: 'go.mod'
cache: true
- run: go mod download
- run: make fmt
- run: go build -v .
- name: Run linters
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
- run: make test

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
version: latest
go-version-file: 'go.mod'
cache: true
- run: make validate-fmt


generate:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -80,7 +89,7 @@ jobs:
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- run: go mod download
- run: make fmt
- env:
TF_ACC: "1"
run: go test -v -cover ./internal/provider/
Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ $(ENVTEST_ASSETS_DIR):
mkdir -p $(ENVTEST_ASSETS_DIR)
MOCKERY ?= $(ENVTEST_ASSETS_DIR)/mockery
OAPI_CODEGEN ?= $(ENVTEST_ASSETS_DIR)/oapi-codegen
LINTER ?= $(ENVTEST_ASSETS_DIR)/golangci-lint

# Run acceptance tests
.PHONY: testacc
Expand All @@ -25,16 +24,23 @@ test:

.PHONY: fmt
fmt:
golines -w ./
gofmt -w ./
goimports -w ./
[ -z "$$CIRCLECI" ] || git diff --exit-code --color=always # In CI: exit if anything changed

.PHONY: validate-fmt
validate-fmt:
@output=$$(gofmt -l ./); \
if [ -n "$$output" ]; then \
echo "$$output"; \
echo "Please run 'make fmt' to format the code"; \
exit 1; \
fi

.PHONY: dep
dep:
go mod download
go install golang.org/x/tools/cmd/goimports
go install github.com/segmentio/golines@latest
go mod tidy

.PHONY: build
Expand Down
18 changes: 8 additions & 10 deletions internal/clients/iam/api.gen.go

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

38 changes: 38 additions & 0 deletions internal/clients/platform/api.gen.go

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

0 comments on commit 0f954f2

Please sign in to comment.