From 0d880895a44cf4bbca19ec8c564064632a5c10f2 Mon Sep 17 00:00:00 2001 From: Ryan Slade Date: Tue, 17 Dec 2024 17:31:33 +0100 Subject: [PATCH] Use gofumpt in the `make format` rule (#541) --- .github/workflows/build.yml | 9 +++++++++ Makefile | 1 + 2 files changed, 10 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97b6d838..71f988bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -102,6 +102,15 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + + - name: Install gofumpt tool + run: | + go install mvdan.cc/gofumpt@latest + - name: Generate types run: | chmod 666 pkg/state/init.sql diff --git a/Makefile b/Makefile index 5f53070f..bbe6cd61 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ format: docker run --rm -v $$PWD/schema.json:/mnt/schema.json node:alpine npx prettier /mnt/schema.json --parser json --tab-width 2 --single-quote --trailing-comma all --no-semi --arrow-parens always --print-width 120 --write # Format embedded SQL docker run --rm -v $$PWD/pkg/state/init.sql:/data/init.sql backplane/pgformatter --inplace /data/init.sql + gofumpt -w . generate: format # Generate the types from the JSON schema