Skip to content

Commit 2b83a5a

Browse files
committed
ci(.github/workflows): add gofmt check
Adds a `make fmt` target that runs `gofmt -w .` and a matching `fmt` job in the existing Lint workflow. The job runs `make fmt` and fails via the existing `scripts/check_unstaged.sh` when any Go file is not formatted. Generated with Coder Agents.
1 parent 2b53f0c commit 2b83a5a

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/lint.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,17 @@ jobs:
3535
${{ env.LINT_CACHE_DIR }}
3636
key: golangci-lint-${{ runner.os }}-${{ hashFiles('**/*.go') }}
3737
restore-keys: |
38-
golangci-lint-${{ runner.os }}-
38+
golangci-lint-${{ runner.os }}-
39+
40+
fmt:
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 5
43+
steps:
44+
- uses: actions/checkout@v5.0.0
45+
- uses: actions/setup-go@v5
46+
with:
47+
go-version: 1.22.8
48+
- name: make fmt
49+
run: make fmt
50+
- name: Check for unstaged files
51+
run: ./scripts/check_unstaged.sh

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ gen:
55

66
.PHONY: clean-testdata
77
clean-testdata:
8-
git clean -xfd testdata
8+
git clean -xfd testdata
9+
10+
.PHONY: fmt
11+
fmt:
12+
gofmt -w .

0 commit comments

Comments
 (0)