From 390702b097b0b8d8e00528208457ea2d713701bc Mon Sep 17 00:00:00 2001 From: Jesse Portnoy Date: Wed, 19 Jul 2023 18:27:35 +0100 Subject: [PATCH] run `gofmt` in CI --- .github/workflows/go.yml | 5 ++++- helpers_test.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6c47a2e..5ede458 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -25,4 +25,7 @@ jobs: run: cd examples && go mod tidy && go build syncat.go - name: Test - run: go test -v + run: | + FMT_ISSUES=$(gofmt -l .) + if test -n "$FMT_ISSUES" ;then printf "gofmt found problems:\n$FMT_ISSUES\n";exit 11; fi + go test -v diff --git a/helpers_test.go b/helpers_test.go index 257e4f0..b58e3b4 100644 --- a/helpers_test.go +++ b/helpers_test.go @@ -9,7 +9,7 @@ import ( func getDefs(t *testing.T, filename string, data []byte, highlight_lexer string) *Def { var def *Def - syn_dir := "./syntax_files" + syn_dir := "./syntax_files" var defs []*Def lerr, warnings := ParseSyntaxFiles(syn_dir, &defs)