From be5b6bf35e61ca23c82d65501cc933bbfe8ea423 Mon Sep 17 00:00:00 2001
From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com>
Date: Fri, 1 Mar 2024 12:52:47 +0000
Subject: [PATCH] [CI] Coverage + pre-commit (backport #49) (#53)
---
.github/workflows/README.md | 4 +-
.github/workflows/ci-coverage-build.yml | 47 ---------
.github/workflows/ci-format.yml | 23 -----
.github/workflows/ci-ros-lint.yml | 44 ---------
.github/workflows/humble-coverage-build.yml | 18 ++++
.github/workflows/humble-pre-commit.yml | 18 ++++
.../workflows/humble-rhel-binary-build.yml | 33 -------
.../reusable-industrial-ci-with-cache.yml | 96 -------------------
.../reusable-ros-tooling-source-build.yml | 50 ----------
.github/workflows/rolling-coverage-build.yml | 18 ++++
.github/workflows/rolling-pre-commit.yml | 18 ++++
.../workflows/rolling-rhel-binary-build.yml | 33 -------
.github/workflows/update-pre-commit.yml | 12 +++
.pre-commit-config.yaml | 39 ++++----
CONTRIBUTING.md | 5 +-
README.md | 3 +
codecov.yml | 17 ++++
17 files changed, 132 insertions(+), 346 deletions(-)
delete mode 100644 .github/workflows/ci-coverage-build.yml
delete mode 100644 .github/workflows/ci-format.yml
delete mode 100644 .github/workflows/ci-ros-lint.yml
create mode 100644 .github/workflows/humble-coverage-build.yml
create mode 100644 .github/workflows/humble-pre-commit.yml
delete mode 100644 .github/workflows/humble-rhel-binary-build.yml
delete mode 100644 .github/workflows/reusable-industrial-ci-with-cache.yml
delete mode 100644 .github/workflows/reusable-ros-tooling-source-build.yml
create mode 100644 .github/workflows/rolling-coverage-build.yml
create mode 100644 .github/workflows/rolling-pre-commit.yml
delete mode 100644 .github/workflows/rolling-rhel-binary-build.yml
create mode 100644 .github/workflows/update-pre-commit.yml
create mode 100644 codecov.yml
diff --git a/.github/workflows/README.md b/.github/workflows/README.md
index a7490ce..d67e0b9 100644
--- a/.github/workflows/README.md
+++ b/.github/workflows/README.md
@@ -1,8 +1,8 @@
ROS2 Distro | Branch | Build status | Documentation | Released packages
:---------: | :----: | :----------: | :-----------: | :---------------:
-**Rolling** | [`rolling`](https://github.com/ros-controls/kinematics_interface/tree/rolling) | [![Rolling Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-binary-build-main.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-binary-build-main.yml?branch=master)
[![Rolling Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-binary-build-testing.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-binary-build-testing.yml?branch=master)
[![Rolling Semi-Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-semi-binary-build-main.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-semi-binary-build-main.yml?branch=master)
[![Rolling Semi-Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-semi-binary-build-testing.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-semi-binary-build-testing.yml?branch=master)
[![Rolling Source Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-source-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-source-build.yml?branch=master) | | [kinematics_interface](https://index.ros.org/p/kinematics_interface/#rolling)
-**Humble** | [`humble`](https://github.com/ros-controls/kinematics_interface/tree/humble) | [![Humble Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-binary-build-main.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-binary-build-main.yml?branch=master)
[![Humble Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-binary-build-testing.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-binary-build-testing.yml?branch=master)
[![Humble Semi-Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-semi-binary-build-main.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-semi-binary-build-main.yml?branch=master)
[![Humble Semi-Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-semi-binary-build-testing.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-semi-binary-build-testing.yml?branch=master)
[![Humble Source Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-source-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-source-build.yml?branch=master) | | [kinematics_interface](https://index.ros.org/p/kinematics_interface/#humble)
+**Rolling** | [`rolling`](https://github.com/ros-controls/kinematics_interface/tree/rolling) | [![Rolling Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-binary-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-binary-build.yml?branch=master)
[![Rolling Semi-Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-semi-binary-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-semi-binary-build.yml?branch=master)
[![Rolling Source Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-source-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/rolling-source-build.yml?branch=master) | [API](http://docs.ros.org/en/rolling/p/kinematics_interface/) | [kinematics_interface](https://index.ros.org/p/kinematics_interface/#rolling)
+**Humble** | [`humble`](https://github.com/ros-controls/kinematics_interface/tree/humble) | [![Humble Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-binary-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-binary-build.yml?branch=master)
[![Humble Semi-Binary Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-semi-binary-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-semi-binary-build.yml?branch=master)
[![Humble Source Build](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-source-build.yml/badge.svg?branch=master)](https://github.com/ros-controls/kinematics_interface/actions/workflows/humble-source-build.yml?branch=master) | [API](http://docs.ros.org/en/humble/p/kinematics_interface/) | [kinematics_interface](https://index.ros.org/p/kinematics_interface/#humble)
### Explanation of different build types
diff --git a/.github/workflows/ci-coverage-build.yml b/.github/workflows/ci-coverage-build.yml
deleted file mode 100644
index 51a82dd..0000000
--- a/.github/workflows/ci-coverage-build.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-name: Coverage Build
-on:
- workflow_dispatch:
- pull_request:
- branches:
- - master
-
-jobs:
- coverage:
- name: coverage build
- runs-on: ubuntu-22.04
- strategy:
- fail-fast: false
- env:
- ROS_DISTRO: rolling
- steps:
- - uses: ros-tooling/setup-ros@v0.7
- with:
- required-ros-distributions: ${{ env.ROS_DISTRO }}
- - uses: actions/checkout@v3
- - uses: ros-tooling/action-ros-ci@0.3.6
- with:
- target-ros2-distro: ${{ env.ROS_DISTRO }}
- import-token: ${{ secrets.GITHUB_TOKEN }}
- # build all packages listed in the meta package
- package-name:
- kinematics_interface_kdl
- kinematics_interface
-
- vcs-repo-file-url: |
- https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/kinematics_interface-not-released.${{ env.ROS_DISTRO }}.repos?token=${{ secrets.GITHUB_TOKEN }}
- colcon-defaults: |
- {
- "build": {
- "mixin": ["coverage-gcc"]
- }
- }
- colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
- - uses: codecov/codecov-action@v4.0.1
- with:
- file: ros_ws/lcov/total_coverage.info
- flags: unittests
- name: codecov-umbrella
- - uses: actions/upload-artifact@v4
- with:
- name: colcon-logs-coverage-rolling
- path: ros_ws/log
diff --git a/.github/workflows/ci-format.yml b/.github/workflows/ci-format.yml
deleted file mode 100644
index 094dc8d..0000000
--- a/.github/workflows/ci-format.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-# 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
-
-on:
- workflow_dispatch:
- pull_request:
-
-jobs:
- pre-commit:
- name: Format
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - uses: actions/setup-python@v5.0.0
- with:
- python-version: '3.10'
- - name: Install system hooks
- run: sudo apt install -qq clang-format-14 cppcheck
- - uses: pre-commit/action@v3.0.1
- with:
- extra_args: --all-files --hook-stage manual
diff --git a/.github/workflows/ci-ros-lint.yml b/.github/workflows/ci-ros-lint.yml
deleted file mode 100644
index ff714ae..0000000
--- a/.github/workflows/ci-ros-lint.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-name: ROS Lint
-on:
- pull_request:
-
-jobs:
- ament_lint:
- name: ament_${{ matrix.linter }}
- runs-on: ubuntu-22.04
- strategy:
- fail-fast: false
- matrix:
- linter: [cppcheck, copyright, lint_cmake]
- env:
- AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: true
- steps:
- - uses: actions/checkout@v3
- - uses: ros-tooling/setup-ros@v0.7
- - uses: ros-tooling/action-ros-lint@v0.1
- with:
- distribution: rolling
- linter: ${{ matrix.linter }}
- package-name:
- kinematics_interface_kdl
- kinematics_interface
-
-
- ament_lint_100:
- name: ament_${{ matrix.linter }}
- runs-on: ubuntu-22.04
- strategy:
- fail-fast: false
- matrix:
- linter: [cpplint]
- steps:
- - uses: actions/checkout@v3
- - uses: ros-tooling/setup-ros@v0.7
- - uses: ros-tooling/action-ros-lint@v0.1
- with:
- distribution: rolling
- linter: cpplint
- arguments: "--linelength=100 --filter=-whitespace/newline"
- package-name:
- kinematics_interface_kdl
- kinematics_interface
diff --git a/.github/workflows/humble-coverage-build.yml b/.github/workflows/humble-coverage-build.yml
new file mode 100644
index 0000000..3331352
--- /dev/null
+++ b/.github/workflows/humble-coverage-build.yml
@@ -0,0 +1,18 @@
+name: Coverage Build - Humble
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - humble
+ pull_request:
+ branches:
+ - humble
+
+jobs:
+ coverage_humble:
+ name: coverage build - humble
+ uses: ros-controls/ros2_control_ci/.github/workflows/reusable-build-coverage.yml@master
+ secrets: inherit
+ with:
+ ros_distro: humble
+ os_name: ubuntu-22.04
diff --git a/.github/workflows/humble-pre-commit.yml b/.github/workflows/humble-pre-commit.yml
new file mode 100644
index 0000000..039c0a8
--- /dev/null
+++ b/.github/workflows/humble-pre-commit.yml
@@ -0,0 +1,18 @@
+name: Humble Pre-Commit
+
+on:
+ workflow_dispatch:
+ pull_request:
+ branches:
+ - humble
+
+jobs:
+ pre-commit:
+ uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master
+ strategy:
+ fail-fast: false
+ matrix:
+ ROS_DISTRO: [humble]
+ with:
+ ros_distro: ${{ matrix.ROS_DISTRO }}
+ os_name: ubuntu-22.04
diff --git a/.github/workflows/humble-rhel-binary-build.yml b/.github/workflows/humble-rhel-binary-build.yml
deleted file mode 100644
index 6d3683b..0000000
--- a/.github/workflows/humble-rhel-binary-build.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-name: Humble RHEL Binary Build
-on:
- workflow_dispatch:
- branches:
- - master
- pull_request:
- branches:
- - master
- push:
- branches:
- - master
- schedule:
- # Run every day to detect flakiness and broken dependencies
- - cron: '03 1 * * *'
-
-
-jobs:
- humble_rhel_binary:
- name: Humble RHEL binary build
- runs-on: ubuntu-latest
- env:
- ROS_DISTRO: humble
- container: ghcr.io/ros-controls/ros:humble-rhel
- steps:
- - uses: actions/checkout@v3
- with:
- path: src/kinematics_interface
- - run: |
- rosdep update
- rosdep install -iy --from-path src/kinematics_interface
- source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
- colcon build
- colcon test
diff --git a/.github/workflows/reusable-industrial-ci-with-cache.yml b/.github/workflows/reusable-industrial-ci-with-cache.yml
deleted file mode 100644
index bccad12..0000000
--- a/.github/workflows/reusable-industrial-ci-with-cache.yml
+++ /dev/null
@@ -1,96 +0,0 @@
-name: Reusable industrial_ci Workflow with Cache
-# Reusable action to simplify dealing with ROS/ROS2 industrial_ci builds with cache
-# author: Denis Štogl
-
-on:
- workflow_call:
- inputs:
- ref_for_scheduled_build:
- description: 'Reference on which the repo should be checkout for scheduled build. Usually is this name of a branch or a tag.'
- default: ''
- required: false
- type: string
-
- upstream_workspace:
- description: 'UPSTREAM_WORKSPACE variable for industrial_ci. Usually path to local .repos file.'
- required: true
- type: string
- ros_distro:
- description: 'ROS_DISTRO variable for industrial_ci'
- required: true
- type: string
- ros_repo:
- description: 'ROS_REPO to run for industrial_ci. Possible values: "main", "testing"'
- default: 'main'
- required: false
- type: string
- os_code_name:
- description: 'OS_CODE_NAME variable for industrial_ci'
- default: ''
- required: false
- type: string
- before_install_upstream_dependencies:
- description: 'BEFORE_INSTALL_UPSTREAM_DEPENDENCIES variable for industrial_ci'
- default: ''
- required: false
- type: string
-
- ccache_dir:
- description: 'Local path to store cache (from "github.workspace"). For standard industrial_ci configuration do not have to be changed'
- default: '.ccache'
- required: false
- type: string
- basedir:
- description: 'Local path to workspace base directory to cache (from "github.workspace"). For standard industrial_ci configuration do not have to be changed'
- default: '.work'
- required: false
- type: string
-
-
-jobs:
- reusable_industrial_ci_with_cache:
- name: ${{ inputs.ros_distro }} ${{ inputs.ros_repo }} ${{ inputs.os_code_name }}
- runs-on: ubuntu-latest
- env:
- CCACHE_DIR: ${{ github.workspace }}/${{ inputs.ccache_dir }}
- BASEDIR: ${{ github.workspace }}/${{ inputs.basedir }}
- CACHE_PREFIX: ${{ inputs.ros_distro }}-${{ inputs.os_code_name }}-${{ inputs.ros_repo }}-${{ github.job }}
- steps:
- - name: Checkout ${{ inputs.ref }} when build is not scheduled
- if: ${{ github.event_name != 'schedule' }}
- uses: actions/checkout@v3
- - name: Checkout ${{ inputs.ref }} on scheduled build
- if: ${{ github.event_name == 'schedule' }}
- uses: actions/checkout@v3
- with:
- ref: ${{ inputs.ref_for_scheduled_build }}
- - name: cache target_ws
- if: ${{ ! matrix.env.CCOV }}
- uses: pat-s/always-upload-cache@v3.0.11
- with:
- path: ${{ env.BASEDIR }}/target_ws
- key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }}
- restore-keys: |
- target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}
- - name: cache ccache
- uses: pat-s/always-upload-cache@v3.0.11
- with:
- path: ${{ env.CCACHE_DIR }}
- key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
- restore-keys: |
- ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}
- ccache-${{ env.CACHE_PREFIX }}
- - uses: 'ros-industrial/industrial_ci@master'
- env:
- UPSTREAM_WORKSPACE: ${{ inputs.upstream_workspace }}
- ROS_DISTRO: ${{ inputs.ros_distro }}
- ROS_REPO: ${{ inputs.ros_repo }}
- OS_CODE_NAME: ${{ inputs.os_code_name }}
- BEFORE_INSTALL_UPSTREAM_DEPENDENCIES: ${{ inputs.before_install_upstream_dependencies }}
- - name: prepare target_ws for cache
- if: ${{ always() && ! matrix.env.CCOV }}
- run: |
- du -sh ${{ env.BASEDIR }}/target_ws
- sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete
- sudo rm -rf ${{ env.BASEDIR }}/target_ws/src
- du -sh ${{ env.BASEDIR }}/target_ws
diff --git a/.github/workflows/reusable-ros-tooling-source-build.yml b/.github/workflows/reusable-ros-tooling-source-build.yml
deleted file mode 100644
index 17994c0..0000000
--- a/.github/workflows/reusable-ros-tooling-source-build.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-name: Reusable industrial_ci Workflow with Cache
-# Reusable action to simplify dealing with ROS/ROS2 industrial_ci builds with cache
-# author: Denis Štogl
-
-on:
- workflow_call:
- inputs:
- ros_distro:
- description: 'ROS2 distribution name'
- required: true
- type: string
- ref:
- description: 'Reference on which the repo should be checkout. Usually is this name of a branch or a tag.'
- required: true
- type: string
- ros2_repo_branch:
- description: 'Branch in the ros2/ros2 repozitory from which ".repos" should be used. Possible values: master (Rolling), humble, galactic, foxy.'
- default: 'master'
- required: false
- type: string
-
-jobs:
- reusable_ros_tooling_source_build:
- name: ${{ inputs.ros_distro }} ubuntu-22.04
- runs-on: ubuntu-22.04
- strategy:
- fail-fast: false
- steps:
- - uses: ros-tooling/setup-ros@v0.7
- with:
- required-ros-distributions: ${{ inputs.ros_distro }}
- - uses: actions/checkout@v3
- with:
- ref: ${{ inputs.ref }}
- - uses: ros-tooling/action-ros-ci@0.3.6
- with:
- target-ros2-distro: ${{ inputs.ros_distro }}
- # build all packages listed in the meta package
- package-name:
- kinematics_interface_kdl
- kinematics_interface
-
- vcs-repo-file-url: |
- https://raw.githubusercontent.com/ros2/ros2/${{ inputs.ros2_repo_branch }}/ros2.repos
- https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/kinematics_interface.${{ inputs.ros_distro }}.repos?token=${{ secrets.GITHUB_TOKEN }}
- colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
- - uses: actions/upload-artifact@v4
- with:
- name: colcon-logs-ubuntu-22.04
- path: ros_ws/log
diff --git a/.github/workflows/rolling-coverage-build.yml b/.github/workflows/rolling-coverage-build.yml
new file mode 100644
index 0000000..63bf7ec
--- /dev/null
+++ b/.github/workflows/rolling-coverage-build.yml
@@ -0,0 +1,18 @@
+name: Coverage Build - Rolling
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ coverage_rolling:
+ name: coverage build - rolling
+ uses: ros-controls/ros2_control_ci/.github/workflows/reusable-build-coverage.yml@master
+ secrets: inherit
+ with:
+ ros_distro: rolling
+ os_name: ubuntu-22.04
diff --git a/.github/workflows/rolling-pre-commit.yml b/.github/workflows/rolling-pre-commit.yml
new file mode 100644
index 0000000..cbb4c5c
--- /dev/null
+++ b/.github/workflows/rolling-pre-commit.yml
@@ -0,0 +1,18 @@
+name: Pre-Commit
+
+on:
+ workflow_dispatch:
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ pre-commit:
+ uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master
+ strategy:
+ fail-fast: false
+ matrix:
+ ROS_DISTRO: [rolling, iron]
+ with:
+ ros_distro: ${{ matrix.ROS_DISTRO }}
+ os_name: ubuntu-22.04
diff --git a/.github/workflows/rolling-rhel-binary-build.yml b/.github/workflows/rolling-rhel-binary-build.yml
deleted file mode 100644
index 4287760..0000000
--- a/.github/workflows/rolling-rhel-binary-build.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-name: Rolling RHEL Binary Build
-on:
- workflow_dispatch:
- branches:
- - master
- pull_request:
- branches:
- - master
- push:
- branches:
- - master
- schedule:
- # Run every day to detect flakiness and broken dependencies
- - cron: '03 1 * * *'
-
-
-jobs:
- rolling_rhel_binary:
- name: Rolling RHEL binary build
- runs-on: ubuntu-latest
- env:
- ROS_DISTRO: rolling
- container: jaronl/ros:rolling-alma
- steps:
- - uses: actions/checkout@v3
- with:
- path: src/kinematics_interface
- - run: |
- rosdep update
- rosdep install -iy --from-path src/kinematics_interface
- source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash
- colcon build
- colcon test
diff --git a/.github/workflows/update-pre-commit.yml b/.github/workflows/update-pre-commit.yml
new file mode 100644
index 0000000..8b9545d
--- /dev/null
+++ b/.github/workflows/update-pre-commit.yml
@@ -0,0 +1,12 @@
+name: Auto Update pre-commit
+# Update pre-commit config and create PR if changes are detected
+# author: Christoph Fröhlich
+
+on:
+ workflow_dispatch:
+ schedule:
+ - cron: '0 0 * * 0' # Run every Sunday at midnight
+
+jobs:
+ auto_update_and_create_pr:
+ uses: ros-controls/ros2_control_ci/.github/workflows/reusable-update-pre-commit.yml@master
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 5545b49..ec3cbbf 100755
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -16,7 +16,7 @@
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.4.0
+ rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-ast
@@ -36,7 +36,7 @@ repos:
# Python hooks
- repo: https://github.com/asottile/pyupgrade
- rev: v3.4.0
+ rev: v3.15.1
hooks:
- id: pyupgrade
args: [--py36-plus]
@@ -48,21 +48,23 @@ repos:
- id: pydocstyle
args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"]
+ - repo: https://github.com/psf/black
+ rev: 24.2.0
+ hooks:
+ - id: black
+ args: ["--line-length=99"]
+
- repo: https://github.com/pycqa/flake8
- rev: 6.0.0
+ rev: 7.0.0
hooks:
- id: flake8
args: ["--extend-ignore=E501"]
# CPP hooks
- - repo: local
+ - repo: https://github.com/pre-commit/mirrors-clang-format
+ rev: v17.0.6
hooks:
- id: clang-format
- name: clang-format
- description: Format files with ClangFormat.
- entry: clang-format-14
- 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
@@ -70,18 +72,15 @@ repos:
- id: ament_cppcheck
name: ament_cppcheck
description: Static code analysis of C/C++ files.
- stages: [commit]
- entry: ament_cppcheck
+ entry: env AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS=1 ament_cppcheck
language: system
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
- # Maybe use https://github.com/cpplint/cpplint instead
- repo: local
hooks:
- id: ament_cpplint
name: ament_cpplint
description: Static code analysis of C/C++ files.
- stages: [commit]
entry: ament_cpplint
language: system
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
@@ -93,7 +92,6 @@ repos:
- id: ament_lint_cmake
name: ament_lint_cmake
description: Check format of CMakeLists.txt files.
- stages: [commit]
entry: ament_lint_cmake
language: system
files: CMakeLists\.txt$
@@ -104,7 +102,6 @@ repos:
- id: ament_copyright
name: ament_copyright
description: Check if copyright notice is available in all files.
- stages: [commit]
entry: ament_copyright
language: system
@@ -127,8 +124,18 @@ repos:
# Spellcheck in comments and docs
# skipping of *.svg files is not working...
- repo: https://github.com/codespell-project/codespell
- rev: v2.2.4
+ rev: v2.2.6
hooks:
- id: codespell
args: ['--write-changes']
exclude: CHANGELOG\.rst|\.(svg|pyc)$
+
+ - repo: https://github.com/python-jsonschema/check-jsonschema
+ rev: 0.28.0
+ hooks:
+ - id: check-github-workflows
+ args: ["--verbose"]
+ - id: check-github-actions
+ args: ["--verbose"]
+ - id: check-dependabot
+ args: ["--verbose"]
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 07a84a5..adadaa2 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -54,7 +54,9 @@ As this project, by default, uses the default GitHub issue labels
## Licensing
-Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license]:
+Any contribution that you make to this repository will
+be under the Apache 2 License, as dictated by that
+[license](http://www.apache.org/licenses/LICENSE-2.0.html):
~~~
5. Submission of Contributions. Unless You explicitly state otherwise,
@@ -69,4 +71,3 @@ Any contribution that you make to this repository will be under the Apache 2 Lic
[issues]: https://github.com/ros-controls/kinematics_interface/issues
[closed-issues]: https://github.com/ros-controls/kinematics_interface/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20
[help-wanted]: https://github.com/ros-controls/kinematics_interface/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22
-[license]: http://www.apache.org/licenses/LICENSE-2.0.html
diff --git a/README.md b/README.md
index c468730..4b7baa5 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,7 @@
# kinematics_interface
+[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
+[![codecov](https://codecov.io/gh/ros-controls/kinematics_interface/branch/humble/graph/badge.svg?token=NS73VKPG9V)](https://codecov.io/gh/ros-controls/kinematics_interface)
+
This is a ROS 2 package for using C++ kinematics frameworks in the context of ROS 2 control. A kinematics interface is designed to allow ROS 2 controllers to control robots in Cartesian space. This package also contains a basic implementation of the interface using KDL.
## Build status
diff --git a/codecov.yml b/codecov.yml
new file mode 100644
index 0000000..7b686b4
--- /dev/null
+++ b/codecov.yml
@@ -0,0 +1,17 @@
+coverage:
+ precision: 2
+ round: down
+ range: "35...100"
+ status:
+ project:
+ default:
+ informational: true
+ patch: off
+fixes:
+ - "ros_ws/src/kinematics_interface/::"
+ignore:
+ - "**/test"
+ - "test"
+comment:
+ layout: "diff, flags, files"
+ behavior: default