Commit 0eec27d3 authored by Felipe Lema's avatar Felipe Lema
Browse files

add clang-format to CI

- this will run clang-format on all changed C/C++ files
- list of changed files is taken from
https://forum.gitlab.com/t/ci-cd-pipeline-get-list-of-changed-files/26847/18
- loosely based on okular setup
parent 9d832b4d
Pipeline #70787 failed with stage
in 61 minutes and 10 seconds
variables:
DEBIAN_FRONTEND: "noninteractive"
include:
- https://invent.kde.org/sysadmin/ci-tooling/raw/master/invent/ci-before.yml
- https://invent.kde.org/sysadmin/ci-tooling/raw/master/invent/ci-applications-linux.yml
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-11
script:
- wget -c --output-document=.clang-format https://invent.kde.org/frameworks/extra-cmake-modules/raw/master/kde-modules/clang-format.cmake
- git diff-tree --no-commit-id --name-only -r origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME -r $CI_COMMIT_SHA | grep -v -P '[.](c|cc|cpp|hpp|h)$'| xargs clang-format-11 -i
- git diff --exit-code
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment