ci: show diff when clang-format check fails
authorEric Engestrom <eric@igalia.com>
Fri, 26 May 2023 13:49:38 +0000 (14:49 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 26 May 2023 16:04:57 +0000 (16:04 +0000)
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23258>

.gitlab-ci/test/gitlab-ci.yml

index 9832fa0..90e888d 100644 (file)
@@ -42,9 +42,10 @@ clang-format:
     LLVM_VERSION: 15
   script:
     - shopt -s globstar
-    - clang-format-${LLVM_VERSION:?} --Werror --dry-run
+    - clang-format-${LLVM_VERSION:?} --Werror -i
       src/**/asahi/**/*.{h,c,cpp}
       src/**/panfrost/**/*.{h,c,cpp}
+    - git diff --exit-code  # Fails if there are diffs
 
 .test-gl:
   extends: