From 2fd013b593f052eb2fcd363c95709669fcd0624f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 16 Aug 2022 09:46:14 +0530 Subject: [PATCH] Add source code linting for go to CI --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6f70ebde..d3ec14e76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: fetch-depth: 0 # needed for :commit: docs role - name: Test for trailing whitespace - run: if grep -Inr '\s$' kitty kitty_tests kittens docs *.py *.asciidoc *.rst .gitattributes .gitignore; then echo Trailing whitespace found, aborting.; exit 1; fi + run: if grep -Inr '\s$' kitty kitty_tests kittens docs *.py *.asciidoc *.rst *.go .gitattributes .gitignore; then echo Trailing whitespace found, aborting.; exit 1; fi - name: Set up Python uses: actions/setup-python@v3 @@ -94,6 +94,9 @@ jobs: - name: Run pyflakes run: python -m flake8 --count . + - name: Run gofmt + run: unformatted=$(gofmt -s -l tools version.go); [ -n "$unformatted" ] && { echo "$unformatted"; exit 1 } + - name: Build kitty package run: python .github/workflows/ci.py package