Skip to content
Snippets Groups Projects
Commit d9684853 authored by Prada Sarasola, Miguel's avatar Prada Sarasola, Miguel
Browse files

Add clang-format test for C++ code

parent 05ec1274
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ before_script: ...@@ -21,6 +21,7 @@ before_script:
- apk add --update bash coreutils tar - apk add --update bash coreutils tar
- git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .ci_config -b legacy - git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .ci_config -b legacy
- docker login ${ARTIFACT_DOCKER_URL} -u ${ARTIFACT_CI_USER} -p ${ARTIFACT_CI_TOKEN} - docker login ${ARTIFACT_DOCKER_URL} -u ${ARTIFACT_CI_USER} -p ${ARTIFACT_CI_TOKEN}
- wget https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/13-add-clang-format-to-the-ci-tests/clang-format -O .clang-format
script: .ci_config/gitlab.sh script: .ci_config/gitlab.sh
variables: variables:
ADDITIONAL_DEBS: curl ADDITIONAL_DEBS: curl
...@@ -75,6 +76,16 @@ industrial_ci_kinetic_deploy: ...@@ -75,6 +76,16 @@ industrial_ci_kinetic_deploy:
only: only:
- tags - tags
clang_format:
extends: .industrial_ci
variables:
ROS_DISTRO: kinetic
CLANG_FORMAT_CHECK: file
except:
- tags
- melodic-devel
allow_failure: yes
########################################################## ##########################################################
## Simple check for basic Python syntax errors; this is much less thorough than ## Simple check for basic Python syntax errors; this is much less thorough than
## other options like pylint, but much faster and less strict ## other options like pylint, but much faster and less strict
......
...@@ -21,6 +21,7 @@ before_script: ...@@ -21,6 +21,7 @@ before_script:
- apk add --update bash coreutils tar - apk add --update bash coreutils tar
- git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .ci_config -b legacy - git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .ci_config -b legacy
- docker login ${ARTIFACT_DOCKER_URL} -u ${ARTIFACT_CI_USER} -p ${ARTIFACT_CI_TOKEN} - docker login ${ARTIFACT_DOCKER_URL} -u ${ARTIFACT_CI_USER} -p ${ARTIFACT_CI_TOKEN}
- wget https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/13-add-clang-format-to-the-ci-tests/clang-format -O .clang-format
script: .ci_config/gitlab.sh script: .ci_config/gitlab.sh
variables: variables:
ADDITIONAL_DEBS: curl ADDITIONAL_DEBS: curl
...@@ -77,6 +78,16 @@ industrial_ci_kinetic_deploy: ...@@ -77,6 +78,16 @@ industrial_ci_kinetic_deploy:
only: only:
- tags - tags
clang_format:
extends: .industrial_ci
variables:
ROS_DISTRO: kinetic
CLANG_FORMAT_CHECK: file
except:
- tags
- melodic-devel
allow_failure: yes
########################################################## ##########################################################
## Simple check for basic Python syntax errors; this is much less thorough than ## Simple check for basic Python syntax errors; this is much less thorough than
## other options like pylint, but much faster and less strict ## other options like pylint, but much faster and less strict
......
---
BasedOnStyle: Google
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 2
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
BinPackParameters: true
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: false
PointerBindsToType: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 60
PenaltyBreakString: 1
PenaltyBreakFirstLessLess: 1000
PenaltyExcessCharacter: 1000
PenaltyReturnTypeOnItsOwnLine: 90
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: false
Standard: Auto
IndentWidth: 2
TabWidth: 2
UseTab: Never
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
SortIncludes: false
SpaceAfterCStyleCast: false
# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom
# Control of individual brace wrapping cases
BraceWrapping: {
AfterClass: 'true'
AfterControlStatement: 'true'
AfterEnum : 'true'
AfterFunction : 'true'
AfterNamespace : 'true'
AfterStruct : 'true'
AfterUnion : 'true'
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'
}
...
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment