From 79fd1c74cfb1781ee98cad95a3e5ff87aaf270c0 Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Mon, 6 May 2024 13:43:48 +0000 Subject: [PATCH] chore: improve fmt scripts --- .github/workflows/ci.yaml | 2 +- Makefile | 2 +- scripts/check_fmt.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bac46190..44beb4e3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -66,4 +66,4 @@ jobs: go-version: "~1.21" - name: Check format - run: bash ./scripts/check_fmt.sh + run: ./scripts/check_fmt.sh diff --git a/Makefile b/Makefile index 4b52e7b8..c6d96bdb 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ GOARCH := $(shell go env GOARCH) PWD=$(shell pwd) -fmt: **/*.go +fmt: $(shell find . -type f -name '*.go') go run mvdan.cc/gofumpt@v0.6.0 -l -w . develop: diff --git a/scripts/check_fmt.sh b/scripts/check_fmt.sh index be30ba41..e6db0c2a 100755 --- a/scripts/check_fmt.sh +++ b/scripts/check_fmt.sh @@ -2,7 +2,7 @@ list="$(go run mvdan.cc/gofumpt@v0.6.0 -l .)" if [[ -n $list ]]; then - echo -e "error: The following files have changes:\n\n${list}\n\nDiff:\n\n" + echo -n -e "error: The following files have changes:\n\n${list}\n\nDiff:\n\n" go run mvdan.cc/gofumpt@v0.6.0 -d . exit 1 fi