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 . 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,