diff --git a/.clang-format b/.clang-format index 28dedb8..9a6ec50 100644 --- a/.clang-format +++ b/.clang-format @@ -1,64 +1,75 @@ --- BasedOnStyle: Google +ColumnLimit: 120 +MaxEmptyLinesToKeep: 1 +SortIncludes: false + +Standard: Auto +IndentWidth: 2 +TabWidth: 2 +UseTab: Never AccessModifierOffset: -2 ConstructorInitializerIndentWidth: 2 +NamespaceIndentation: None +ContinuationIndentWidth: 4 +IndentCaseLabels: true +IndentFunctionDeclarationAfterType: false + AlignEscapedNewlinesLeft: false AlignTrailingComments: true + AllowAllParametersOfDeclarationOnNextLine: false +ExperimentalAutoDetectBinPacking: false +ObjCSpaceBeforeProtocolList: true +Cpp11BracedListStyle: false + +AllowShortBlocksOnASingleLine: true AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AllowShortFunctionsOnASingleLine: None +AllowShortCaseLabelsOnASingleLine: 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 + +PenaltyExcessCharacter: 50 +PenaltyBreakBeforeFirstCallParameter: 30 +PenaltyBreakComment: 1000 +PenaltyBreakFirstLessLess: 10 PenaltyBreakString: 100 -PenaltyBreakFirstLessLess: 1000 -PenaltyExcessCharacter: 1000 -PenaltyReturnTypeOnItsOwnLine: 70 +PenaltyReturnTypeOnItsOwnLine: 50 + SpacesBeforeTrailingComments: 2 -Cpp11BracedListStyle: false -Standard: Auto -IndentWidth: 2 -TabWidth: 2 -UseTab: Never -IndentFunctionDeclarationAfterType: false SpacesInParentheses: false SpacesInAngles: false SpaceInEmptyParentheses: false SpacesInCStyleCastParentheses: false +SpaceAfterCStyleCast: 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' + AfterCaseLabel: true + AfterClass: true + AfterControlStatement: true + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterStruct: true + AfterUnion: true + BeforeCatch: true + BeforeElse: true + IndentBraces: false ... diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 09c9de8..d7a89eb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,12 @@ name: CI -on: [push, pull_request] +on: + workflow_dispatch: + pull_request: + push: + branches: + - ros2 jobs: default: @@ -11,53 +16,34 @@ jobs: fail-fast: false matrix: env: - - IMAGE: melodic - CCOV: true - CATKIN_LINT: true - UPSTREAM_WORKSPACE: github:PickNikRobotics/rviz_visual_tools#master - - IMAGE: noetic - CATKIN_LINT: true + - ROS_DISTRO: rolling + ROS_REPO: main + - ROS_DISTRO: rolling + ROS_REPO: testing + - ROS_DISTRO: humble + ROS_REPO: main + - ROS_DISTRO: humble + ROS_REPO: testing env: - DOCKER_IMAGE: 'moveit/moveit:${{ matrix.env.IMAGE }}-release' - AFTER_RUN_TARGET_TEST: ${{ matrix.env.CCOV && './.ci.prepare_codecov' || '' }} - TARGET_CMAKE_ARGS: > - -DCMAKE_BUILD_TYPE=${{ matrix.env.CCOV && 'RelWithDebInfo' || 'Release'}} - ${{ matrix.env.CCOV && '-DCMAKE_CXX_FLAGS="--coverage" --no-warn-unused-cli' || '' }} - CCACHE_DIR: "${{ github.workspace }}/.ccache" BASEDIR: ${{ github.workspace }}/.work - CACHE_PREFIX: "${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && '-ccov' || '' }}" - CLANG_TIDY_BASE_REF: "${{ github.base_ref || github.ref }}" + CCACHE_DIR: ~/.ccache - name: "${{ matrix.env.IMAGE }}${{ matrix.env.CATKIN_LINT && ' + catkin_lint' || ''}}${{ matrix.env.CCOV && ' + ccov' || ''}}${{ matrix.env.IKFAST_TEST && ' + ikfast' || ''}}${{ matrix.env.CLANG_TIDY && ' + clang-tidy' || '' }}" + name: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: cache upstream_ws - uses: pat-s/always-upload-cache@v2.1.3 - with: - path: ${{ env.BASEDIR }}/upstream_ws - key: upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('upstream.rosinstall') }}-${{ github.run_id }} - restore-keys: | - upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('upstream.rosinstall') }} - - name: cache ccache - uses: actions/cache@v2 + - uses: actions/cache@v2 with: path: ${{ env.CCACHE_DIR }} - key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} + key: ccache-${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}-${{ github.sha }} restore-keys: | - ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} - ccache-${{ env.CACHE_PREFIX }} - - name: industrial_ci - uses: 'ros-industrial/industrial_ci@master' + ccache-${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} + - id: industrial_ci + uses: ros-industrial/industrial_ci@master env: ${{ matrix.env }} - name: upload test artifacts (on failure) uses: actions/upload-artifact@v2 - if: failure() + if: steps.industrial_ci.outcome != 'success' with: - name: test-results + name: test-results-${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO}} path: ${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml - - name: upload codecov report - uses: codecov/codecov-action@v1 - if: ${{ matrix.env.CCOV }} - with: - files: ${{ env.BASEDIR }}/coverage.info diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml index b3770ce..0416689 100644 --- a/.github/workflows/format.yaml +++ b/.github/workflows/format.yaml @@ -1,31 +1,23 @@ + # This is a format job. Pre-commit has a first-party GitHub action, so we use # that: https://github.com/pre-commit/action -name: Format +name: Formatting (pre-commit) on: workflow_dispatch: pull_request: push: + branches: + - ros2 jobs: pre-commit: - name: pre-commit + name: Format runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - name: Install clang-format-10 - run: sudo apt-get install clang-format-10 - - name: Install catkin-lint - run: | - lsb_release -sc - sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' - sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 - sudo apt-get -q update - sudo apt-get -q install python3-rosdep - sudo rosdep init - rosdep update - sudo apt-get -q install catkin-lint - export ROS_DISTRO=noetic - - uses: pre-commit/action@v2.0.0 + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - name: Install clang-format-10 + run: sudo apt-get install clang-format-10 + - uses: pre-commit/action@v2.0.0 \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index abe766e..4f71fbf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,10 +26,9 @@ repos: - id: debug-statements - id: end-of-file-fixer - id: mixed-line-ending - - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 22.3.0 hooks: - id: black @@ -42,20 +41,3 @@ repos: language: system files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$ args: ['-fallback-style=none', '-i'] - - - repo: local - hooks: - - id: misspelled-moveit - name: misspelled-moveit - description: MoveIt should be spelled exactly as MoveIt - language: pygrep - entry: Moveit|MoveIt! - exclude: .pre-commit-config.yaml|README.md - - - id: catkin_lint - name: catkin_lint - description: Check package.xml and cmake files - entry: catkin_lint . - language: system - always_run: true - pass_filenames: false diff --git a/README.md b/README.md index 5c2b74c..dc013ab 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ repository. For background, see this [Github discussion](https://github.com/ros- ## GitHub Actions - Continuous Integration -[![Format](https://github.com/ros-planning/moveit_calibration/actions/workflows/format.yaml/badge.svg?branch=master)](https://github.com/ros-planning/moveit_calibration/actions/workflows/format.yaml?branch=master) -[![BuildAndTest](https://github.com/ros-planning/moveit_calibration/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/ros-planning/moveit_calibration/actions/workflows/ci.yaml?branch=master) +GitHub Actions: +[![Formatting (pre-commit))](https://github.com/ros-planning/moveit_resources/actions/workflows/format.yml/badge.svg?branch=ros2)](https://github.com/ros-planning/moveit_calibration/actions/workflows/format.yml?query=branch%3Aros2) +[![Build and Test](https://github.com/ros-planning/moveit_resources/actions/workflows/industrial_ci_action.yml/badge.svg?branch=ros2)](https://github.com/ros-planning/moveit_calibration/actions/workflows/industrial_ci_action.yml?query=branch%3Aros2) [![codecov](https://codecov.io/gh/ros-planning/moveit_calibration/branch/master/graph/badge.svg?token=W7uHKcY0ly)](https://codecov.io/gh/ros-planning/moveit_calibration)