From 1429be3a198f712d0a7c1b45bad06b4b518a8000 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 16 Aug 2022 14:47:27 +0530 Subject: [PATCH] Run gofmt via python, easier to debug --- .github/workflows/ci.py | 5 +++++ .github/workflows/ci.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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