Skip to content
Snippets Groups Projects
Commit 77d265d4 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

Merge branch 'feature/clang_tidy_ci' into 'test/clang_format'

Feature/clang tidy ci

See merge request !58
parents 52060cf3 4ec90776
No related branches found
No related tags found
2 merge requests!59Draft: Test/clang format,!58Feature/clang tidy ci
Pipeline #332907 failed
...@@ -44,30 +44,26 @@ stages: ...@@ -44,30 +44,26 @@ stages:
- deploy - deploy
clang-format: clang-format:
image: alpine:latest image: registry.git-ce.rwth-aachen.de/vr-vis/vr-group/unreal-development/plugins/rwth-vr-toolkit/alpine-analyze:latest
tags: tags:
- docker-executor - docker-executor
- linux - linux
rules: rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_PIPELINE_SOURCE == "web"
variables: variables:
GIT_STRATEGY: fetch GIT_STRATEGY: fetch
GIT_CHECKOUT: "true" GIT_CHECKOUT: "true"
GIT_DEPTH: "2" GIT_DEPTH: "2"
stage: analyze stage: analyze
allow_failure: false allow_failure: false
before_script:
- apk update
- apk add clang-extra-tools git python3
script: script:
- ls -la
- clang-format --version - clang-format --version
- linter_errors=$(git-clang-format --commit "HEAD~1" *.h *.cpp -q --diff | grep -v --color=always "no modified files to format" || true) - git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME --depth 1
- echo $CI_MERGE_REQUEST_DIFF_BASE_SHA
- linter_errors=$(unbuffer git-clang-format --commit "$CI_MERGE_REQUEST_DIFF_BASE_SHA" *.h *.cpp -q --diff | grep -v --color=always "no modified files to format" || true)
- echo "$linter_errors" - echo "$linter_errors"
- if [ ! -z "$linter_errors" ]; then echo "Detected formatting issues; please fix"; exit 1; else echo "Formatting is correct"; exit 0; fi - if [ ! -z "$linter_errors" ]; then echo "Detected formatting issues; please fix"; exit 1; else echo "Formatting is correct"; exit 0; fi
Generate_Project: Generate_Project:
only: ['web', 'schedules'] only: ['web', 'schedules']
extends: .Generate_Project_ extends: .Generate_Project_
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment