From 92e7c78f56b4228f2fb6d3e7fc3a69bf3751e9bb Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sat, 11 Jul 2020 00:16:16 +0200 Subject: [PATCH] Check clang-format at CI stage --- .gitlab-ci.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 16004286c..cc6341168 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,7 +29,7 @@ build_ubuntu_20_04: - sed -i -e 's/# deb-src/deb-src/g' /etc/apt/sources.list - apt-get update - apt-get build-dep --yes --no-install-recommends okular - - apt-get install --yes --no-install-recommends ninja-build + - apt-get install --yes --no-install-recommends ninja-build script: - mkdir -p build && cd build - cmake -DOKULAR_UI=desktop -G Ninja .. @@ -55,3 +55,16 @@ build_clazy_clang_tidy: # Fix the poppler header, remove when debian:unstable ships poppler 0.82 or later - sed -i "N;N;N;N; s#class MediaRendition\;\nclass MovieAnnotation\;\nclass ScreenAnnotation;#class MediaRendition\;#g" /usr/include/poppler/qt5/poppler-link.h - run-clang-tidy + +clang_format: + stage: build + image: debian:testing + only: + - merge_requests + - master + before_script: + - apt-get update + - apt-get install --yes --no-install-recommends git clang-format-10 + script: + - find . \( -name "*.cpp" -or -name "*.h" -or -name "*.c" -or -name "*.cc" \) -exec clang-format-10 -i {} \; + - git diff --exit-code