From ca8419fca38b85d371466aa8a6bfaaebc0226fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Mon, 17 Jun 2024 10:51:14 +0100 Subject: containers: fix go-fmt job on failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the go-fmt job was changed to use Alpine, it was seemingly missed that the diffstat command isn't available by default. Instead of depending on an external package, however, we can just let git generate a diffstat if we change the way the job works slightly. Signed-off-by: Daniel P. Berrangé --- containers/go-fmt/go-fmt.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/containers/go-fmt/go-fmt.sh b/containers/go-fmt/go-fmt.sh index daa372c..1895efd 100755 --- a/containers/go-fmt/go-fmt.sh +++ b/containers/go-fmt/go-fmt.sh @@ -2,14 +2,16 @@ GOFMT=$(go env GOROOT)/bin/gofmt -find -name '*.go' | xargs $GOFMT -d -e > go-fmt.patch +find -name '*.go' | xargs $GOFMT -w + +git diff > go-fmt.patch if test -s go-fmt.patch then echo echo "❌ ERROR: some files failed go fmt code style check" echo - diffstat go-fmt.patch + git diff --stat echo echo "See the go-fmt patch artifact for full details of mistakes." echo -- cgit v1.1