diff --git a/.github/workflows/ci.py b/.github/workflows/ci.py index 8440708a8..c97a6ffc7 100644 --- a/.github/workflows/ci.py +++ b/.github/workflows/ci.py @@ -130,6 +130,11 @@ def main(): package_kitty() elif action == 'test': test_kitty() + elif action == 'gofmt': + q = subprocess.check_output('gofmt -s -l tools version.go'.split()) + if q.strip(): + print(q.decode()) + raise SystemExit(1) else: raise SystemExit(f'Unknown action: {action}') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d495b837..cf872b72d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,7 @@ jobs: run: python -m flake8 --count . - name: Run gofmt - run: sh -c 'unformatted=$(gofmt -s -l tools version.go); [ -z "$unformatted" ] || { echo "$unformatted"; exit 1 }' + run: python .github/workflows/ci.py gofmt - name: Build kitty package run: python .github/workflows/ci.py package