From 2f0c50b0492e8ea48a7025a0288b4ae82b449304 Mon Sep 17 00:00:00 2001 From: Zach Kipp Date: Wed, 22 Apr 2026 17:38:39 +0000 Subject: [PATCH 1/2] ci: 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. --- .github/workflows/lint.yml | 15 ++++++++++++++- Makefile | 6 +++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 262b907..857045f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -35,4 +35,17 @@ jobs: ${{ env.LINT_CACHE_DIR }} key: golangci-lint-${{ runner.os }}-${{ hashFiles('**/*.go') }} restore-keys: | - golangci-lint-${{ runner.os }}- \ No newline at end of file + golangci-lint-${{ runner.os }}- + + fmt: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v5.0.0 + - uses: actions/setup-go@v5 + with: + go-version: 1.22.8 + - name: make fmt + run: make fmt + - name: Check for unstaged files + run: ./scripts/check_unstaged.sh diff --git a/Makefile b/Makefile index 590514a..6756db2 100644 --- a/Makefile +++ b/Makefile @@ -5,4 +5,8 @@ gen: .PHONY: clean-testdata clean-testdata: - git clean -xfd testdata \ No newline at end of file + git clean -xfd testdata + +.PHONY: fmt +fmt: + gofmt -w . From 0a8038528130b87f178eeb57f255fc3f68ae956b Mon Sep 17 00:00:00 2001 From: Zach Kipp Date: Wed, 22 Apr 2026 17:38:45 +0000 Subject: [PATCH 2/2] chore: apply gofmt Result of running the newly added `make fmt` against the tree. Generated with Coder Agents. --- types/diagnostics_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/diagnostics_test.go b/types/diagnostics_test.go index 3bd8db6..9f5b1e7 100644 --- a/types/diagnostics_test.go +++ b/types/diagnostics_test.go @@ -40,7 +40,7 @@ func TestDiagnosticExtra(t *testing.T) { // The `parent` wrapped is lost here, so calling `SetDiagnosticExtra` is // lossy. In practice, we only call this once, so it's ok. // TODO: Fix SetDiagnosticExtra to maintain the parents -// if the DiagnosticExtra already exists in the chain. +// if the DiagnosticExtra already exists in the chain. func TestDiagnosticExtraExisting(t *testing.T) { diag := &hcl.Diagnostic{ Severity: hcl.DiagWarning,