diff --git a/.gitlab-industrial-ci-kinetic-no-rosinstall.yml b/.gitlab-industrial-ci-kinetic-no-rosinstall.yml index 866a9c7a0ff2ec72d2232d22ea08f9bad7d9f5af..78c2a4b10250f36deffb026a540a5482ced0c577 100644 --- a/.gitlab-industrial-ci-kinetic-no-rosinstall.yml +++ b/.gitlab-industrial-ci-kinetic-no-rosinstall.yml @@ -21,6 +21,7 @@ before_script: - apk add --update bash coreutils tar - 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} + - 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 variables: ADDITIONAL_DEBS: curl @@ -75,6 +76,16 @@ industrial_ci_kinetic_deploy: only: - 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 ## other options like pylint, but much faster and less strict diff --git a/.gitlab-industrial-ci-kinetic-with-rosinstall.yml b/.gitlab-industrial-ci-kinetic-with-rosinstall.yml index 288675fc99aac8d454185a062a94b69665609021..24555d50685bf2b658c2cd25bfae75ff9251cd7d 100644 --- a/.gitlab-industrial-ci-kinetic-with-rosinstall.yml +++ b/.gitlab-industrial-ci-kinetic-with-rosinstall.yml @@ -21,6 +21,7 @@ before_script: - apk add --update bash coreutils tar - 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} + - 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 variables: ADDITIONAL_DEBS: curl @@ -77,6 +78,16 @@ industrial_ci_kinetic_deploy: only: - 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 ## other options like pylint, but much faster and less strict diff --git a/clang-format b/clang-format new file mode 100644 index 0000000000000000000000000000000000000000..56a30d3761ce7e13701d14bc31eb82dc82b58199 --- /dev/null +++ b/clang-format @@ -0,0 +1,66 @@ +--- +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' +} +...