Skip to content

Commit 0f954f2

Browse files
committed
remove golines
1 parent c3f9b80 commit 0f954f2

File tree

4 files changed

+70
-19
lines changed

4 files changed

+70
-19
lines changed

.github/workflows/test.yml

+15-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ permissions:
1818
jobs:
1919
# Ensure project builds before running testing matrix
2020
build:
21-
name: Build
21+
name: Build and unit test
2222
runs-on: ubuntu-latest
2323
timeout-minutes: 5
2424
steps:
@@ -27,12 +27,21 @@ jobs:
2727
with:
2828
go-version-file: 'go.mod'
2929
cache: true
30-
- run: go mod download
30+
- run: make fmt
3131
- run: go build -v .
32-
- name: Run linters
33-
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
32+
- run: make test
33+
34+
lint:
35+
name: Lint
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
39+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
3440
with:
35-
version: latest
41+
go-version-file: 'go.mod'
42+
cache: true
43+
- run: make validate-fmt
44+
3645

3746
generate:
3847
runs-on: ubuntu-latest
@@ -80,7 +89,7 @@ jobs:
8089
with:
8190
terraform_version: ${{ matrix.terraform }}
8291
terraform_wrapper: false
83-
- run: go mod download
92+
- run: make fmt
8493
- env:
8594
TF_ACC: "1"
8695
run: go test -v -cover ./internal/provider/

Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ $(ENVTEST_ASSETS_DIR):
1010
mkdir -p $(ENVTEST_ASSETS_DIR)
1111
MOCKERY ?= $(ENVTEST_ASSETS_DIR)/mockery
1212
OAPI_CODEGEN ?= $(ENVTEST_ASSETS_DIR)/oapi-codegen
13-
LINTER ?= $(ENVTEST_ASSETS_DIR)/golangci-lint
1413

1514
# Run acceptance tests
1615
.PHONY: testacc
@@ -25,16 +24,23 @@ test:
2524

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

31+
.PHONY: validate-fmt
32+
validate-fmt:
33+
@output=$$(gofmt -l ./); \
34+
if [ -n "$$output" ]; then \
35+
echo "$$output"; \
36+
echo "Please run 'make fmt' to format the code"; \
37+
exit 1; \
38+
fi
39+
3340
.PHONY: dep
3441
dep:
3542
go mod download
3643
go install golang.org/x/tools/cmd/goimports
37-
go install github.com/segmentio/golines@latest
3844
go mod tidy
3945

4046
.PHONY: build

internal/clients/iam/api.gen.go

+8-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/clients/platform/api.gen.go

+38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)