Skip to content

Commit a937afe

Browse files
destoglAndyZe
authored andcommitted
Remove ament_* from format workflow and add them with ros-lit-action
1 parent c2b6af6 commit a937afe

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

.github/workflows/ci-format.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,10 @@ jobs:
1616
name: Format
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: ros-tooling/[email protected]
20-
with:
21-
required-ros-distributions: foxy
2219
- uses: actions/checkout@v2
2320
- uses: actions/setup-python@v2
2421
- name: Install system hooks
2522
run: sudo apt-get install clang-format-10 cppcheck
26-
- name: Source ROS2 environemnt to get access to ament_* hooks
27-
run: source /opt/ros/foxy/setup.bash
28-
- name: Check if there are ament hooks
29-
run: ament_copyright
3023
- uses: pre-commit/[email protected]
24+
with:
25+
extra_args: --all-files --hook-stage manual

.github/workflows/ci-ros-lint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: ROS2 Lint
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
ament_lint:
7+
name: ament_${{ matrix.linter }}
8+
runs-on: ubuntu-20.04
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
linter: [copyright, cppcheck, cpplint]
13+
steps:
14+
- uses: actions/checkout@v1
15+
- uses: ros-tooling/[email protected]
16+
- uses: ros-tooling/[email protected]
17+
with:
18+
distribution: foxy
19+
linter: ${{ matrix.linter }}
20+
package-name:
21+
ros2_control_demo_hardware
22+
ros2_control_demo_robot
23+
ros2_control_demos

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ repos:
2929
- id: end-of-file-fixer
3030
- id: mixed-line-ending
3131
- id: trailing-whitespace
32+
- id: check-byte-order-marker # Forbid UTF-8 byte-order markers
3233

3334
# Python hooks
3435
- repo: https://github.com/asottile/pyupgrade
@@ -69,6 +70,7 @@ repos:
6970
- id: ament_cppcheck
7071
name: ament_cppcheck
7172
description: Static code analysis of C/C++ files.
73+
stages: [commit]
7274
entry: ament_cppcheck
7375
language: system
7476
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
@@ -79,6 +81,7 @@ repos:
7981
- id: ament_cpplint
8082
name: ament_cpplint
8183
description: Static code analysis of C/C++ files.
84+
stages: [commit]
8285
entry: ament_cpplint
8386
language: system
8487
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
@@ -100,6 +103,7 @@ repos:
100103
- id: ament_lint_cmake
101104
name: ament_lint_cmake
102105
description: Check format of CMakeLists.txt files.
106+
stages: [commit]
103107
entry: ament_lint_cmake
104108
language: system
105109
files: CMakeLists.txt$
@@ -110,6 +114,7 @@ repos:
110114
- id: ament_copyright
111115
name: ament_copyright
112116
description: Check if copyright notice is available in all files.
117+
stages: [commit]
113118
entry: ament_copyright
114119
language: system
115120

0 commit comments

Comments
 (0)