From 3ea2c1cb32f91f2b9fe03e1eab9b6f997e08fc96 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Fri, 26 May 2023 18:23:33 +0100 Subject: [PATCH] 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 Part-of: --- .gitlab-ci/test-source-dep.yml | 3 +++ .gitlab-ci/test/gitlab-ci.yml | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci/test-source-dep.yml b/.gitlab-ci/test-source-dep.yml index d06df5c1683..bf50f3088ec 100644 --- a/.gitlab-ci/test-source-dep.yml +++ b/.gitlab-ci/test-source-dep.yml @@ -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 diff --git a/.gitlab-ci/test/gitlab-ci.yml b/.gitlab-ci/test/gitlab-ci.yml index ed28835dc32..200052b206f 100644 --- a/.gitlab-ci/test/gitlab-ci.yml +++ b/.gitlab-ci/test/gitlab-ci.yml @@ -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: