1
0
Fork 0
qemu/tests/lcitool/libvirt-ci/containers/clang-format/clang-format.sh
Daniel Baumann ea34ddeea6
Adding upstream version 1:10.0.2+ds.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-22 14:27:05 +02:00

23 lines
628 B
Bash
Executable file

#!/bin/sh
git ls-tree --name-only -r HEAD | grep '\.[ch]$' | xargs clang-format -i
git diff > clang-format.patch
if test -s clang-format.patch
then
echo
echo "❌ ERROR: some files failed clang-format code style check"
echo
git diff --stat
echo
echo "See the clang-format patch artifact for full details of mistakes."
echo
echo "For guidance on how to configure Emacs or Vim to automatically"
echo "run clang-format when saving files read"
echo
echo " https://clang.llvm.org/docs/ClangFormat.html"
echo
exit 1
fi
echo "✔ OK: all files passed go fmt code style check"