ci: use meson to run clang-format

This will allow us to easily exclude vendored code when we enforce the
formatting of more components later on.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23269>
This commit is contained in:
Eric Engestrom
2023-05-26 18:23:33 +01:00
committed by Marge Bot
parent 2f78ec7d37
commit 3ea2c1cb32
2 changed files with 7 additions and 3 deletions

View File

@@ -994,6 +994,9 @@
rules:
- !reference [.core-rules, rules]
- changes:
- .clang-format
- .clang-format-include
- .clang-format-ignore
- src/**/asahi/**/*
- src/**/panfrost/**/*
when: on_success

View File

@@ -42,9 +42,10 @@ clang-format:
LLVM_VERSION: 15
script:
- shopt -s globstar
- clang-format-${LLVM_VERSION:?} --Werror -i
src/**/asahi/**/*.{h,c,cpp}
src/**/panfrost/**/*.{h,c,cpp}
# We need a meson build dir, but its config doesn't actually matter, so
# let's just use the default.
- meson setup build
- ninja -C build clang-format
- git diff --color=always --exit-code # Fails if there are diffs
.test-gl: