Run gofmt via python, easier to debug

This commit is contained in:
Kovid Goyal 2022-08-16 14:47:27 +05:30
parent 4b69a600e5
commit 1429be3a19
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 1 deletions

View File

@ -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}')

View File

@ -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