From ca4393fc9fe85d2e6b7012ebe6684d972d6e6c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0pa=C4=8Dek?= Date: Thu, 28 Oct 2021 16:39:20 +0200 Subject: [PATCH] retain diff output if clang-format changes something It's major PITA trying to guess what exactly clang-format has changed, so how CI stores patch file with changes which can be applied locally if needed. --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d11ff416fa..8e8f056441 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -446,7 +446,13 @@ clang-format: needs: [] script: - if [ -r .clang-format ]; then "${CLANG_FORMAT}" -i -style=file $(git ls-files '*.c' '*.h'); fi + - git diff > clang-format.patch - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi + artifacts: + paths: + - clang-format.patch + expire_in: "1 week" + when: on_failure coccinelle: <<: *precheck_job