CI: Patch format test

parent cd9114e2
Standard: Latest
BasedOnStyle: LLVM
AccessModifierOffset: -4
IndentWidth: 4
ColumnLimit: 0
TabWidth: 4
UseTab: Never
MaxEmptyLinesToKeep: 1
PointerAlignment: Left
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: true
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: Always
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: true
SpaceInEmptyParentheses: true
SpacesBeforeTrailingComments: 1
SpacesInAngles: true
SpacesInConditionalStatement: true
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: true
SpacesInParentheses: true
SpacesInSquareBrackets: true
SpaceBeforeSquareBrackets: true
...@@ -138,6 +138,30 @@ static-analysis:clang-tidy: ...@@ -138,6 +138,30 @@ static-analysis:clang-tidy:
script: script:
- jq ".[].file" build/compile_commands.json | tr -d "\"" | grep -v "test-src" | xargs -n1 -P$(grep -c processor /proc/cpuinfo) clang-tidy -p build/ - jq ".[].file" build/compile_commands.json | tr -d "\"" | grep -v "test-src" | xargs -n1 -P$(grep -c processor /proc/cpuinfo) clang-tidy -p build/
#######################################################################################################################
# format
.template:code-style:
stage: build
image: gitlab.fit.cvut.cz:5000/algorithms-library-toolkit/ci-docker-images/alt-builder:latest
allow_failure: true # TODO
dependencies: []
# -----------------------------------------------------------------------------
code-style:patch-clang-format:
extends: .template:code-style
script:
- ANCESTOR=$(git merge-base origin/master HEAD) # find nearest common ancestor between HEAD and master
- git diff $ANCESTOR..HEAD | tee orig.patch | /usr/share/clang/clang-format-10/clang-format-diff.py -p1 | sed "s/+++ /+++ b\// g;s/--- /--- a\//g" > clang-format.patch
- if [[ -s clang-format.patch ]]; then cat clang-format.patch; echo "Download the patch in the artifact directory"; false; fi # file exists and has nonzero size - fail
artifacts:
when: always
paths:
- orig.patch
- clang-format.patch
expire_in: 1 day
####################################################################################################################### #######################################################################################################################
# notify # notify
......
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