diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2024-06-17 10:51:14 +0100 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2024-06-17 11:11:08 +0100 |
commit | ca8419fca38b85d371466aa8a6bfaaebc0226fcf (patch) | |
tree | 6381bcfb37c6f6a92150c033f2361a3b21edc890 | |
parent | 9de01d71df02fdbc35539bf074571e97eb74dd4e (diff) | |
download | libvirt-ci-ca8419fca38b85d371466aa8a6bfaaebc0226fcf.zip libvirt-ci-ca8419fca38b85d371466aa8a6bfaaebc0226fcf.tar.gz libvirt-ci-ca8419fca38b85d371466aa8a6bfaaebc0226fcf.tar.bz2 |
containers: fix go-fmt job on failure
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é <berrange@redhat.com>
-rwxr-xr-x | containers/go-fmt/go-fmt.sh | 6 |
1 files 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 |