From 889c80de7065e232a02b58b51aaa1ac5f48d95d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Sverre=20Lien=20Sell=C3=A6g?= Date: Wed, 9 Sep 2020 15:27:51 +0200 Subject: [PATCH] add ci step to catch lint errors --- .gitlab-ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b560503..864c033 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ variables: GIT_SUBMODULE_STRATEGY: recursive stages: + - lint - test - chore @@ -54,6 +55,18 @@ address-sanitizer: - make -j$(nproc) - broadwayd & CTEST_OUTPUT_ON_FAILURE=1 LSAN_OPTIONS=detect_leaks=0 make test +check-format: + image: cppit/jucipp:arch + stage: lint + script: + - 'find src -name "*.cpp" -exec clang-format --Werror --assume-filename={} {} -n 2>> lint-errors.txt \;' + - 'find src -name "*.hpp" -exec clang-format --Werror --assume-filename={} {} -n 2>> lint-errors.txt \;' + - 'find tests -name "*.cpp" -exec clang-format --Werror --assume-filename={} {} -n 2>> lint-errors.txt \;' + - 'find tests -name "*.hpp" -exec clang-format --Werror --assume-filename={} {} -n 2>> lint-errors.txt \;' + - 'HAS_ERRORS=$(cat lint-errors.txt | wc -l)' + - '[ "$HAS_ERRORS" == "0" ] || cat lint-errors.txt' + - '[ "$HAS_ERRORS" == "0" ]' + Clean appveyor cache: stage: chore when: manual