Skip to content

Commit 1451a74

Browse files
authored
refactor: unify pre-commit configs and update CI workflow (#15)
* chore: update .gitignore to exclude .vscode/ and log/ * refactor: merge .pre-commit-config-local.yaml and .pre-commit-config.yaml and update CI workflow to use that new file, also removed pre-commit.ci badge from README * refactor(workflows): update job names and when different workflows run
1 parent 52b90b0 commit 1451a74

File tree

8 files changed

+46
-60
lines changed

8 files changed

+46
-60
lines changed

.github/workflows/code-coverage.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ on:
44
branches:
55
- main
66
pull_request:
7-
branches:
8-
- main
7+
types: [ opened, synchronize, reopened, ready_for_review ]
98
jobs:
10-
call_reusable_workflow:
9+
code-coverage:
1110
uses: vortexntnu/vortex-ci/.github/workflows/reusable-code-coverage.yml@main
1211
secrets:
1312
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/industrial-ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ name: Industrial CI
22

33
on:
44
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [ opened, synchronize, reopened, ready_for_review ]
59
workflow_dispatch:
610
schedule:
711
- cron: '0 1 * * *' # Runs daily to check for dependency issues or flaking tests
812
jobs:
9-
call_reusable_workflow:
13+
industrial-ci:
1014
uses: vortexntnu/vortex-ci/.github/workflows/reusable-industrial-ci.yml@main
1115
with:
1216
ros_repo: '["testing", "main"]'

.github/workflows/pre-commit.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
name: pre-commit
2-
32
on:
3+
push:
4+
branches:
5+
- main
46
pull_request:
7+
types: [ opened, synchronize, reopened, ready_for_review ]
58
workflow_dispatch:
69
jobs:
7-
call_reusable_workflow:
10+
pre-commit:
811
uses: vortexntnu/vortex-ci/.github/workflows/reusable-pre-commit.yml@main
912
with:
1013
ros_distro: 'humble'
11-
config_path: '.pre-commit-config-local.yaml'
14+
config_path: '.pre-commit-config.yaml'

.github/workflows/semantic-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ on:
55
branches:
66
- main
77
jobs:
8-
call_reusable_workflow:
8+
semantic-release:
99
uses: vortexntnu/vortex-ci/.github/workflows/reusable-semantic-release.yml@main

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ qtcreator-*
5050

5151
# Catkin custom files
5252
CATKIN_IGNORE
53+
54+
.vscode/
55+
log/

.pre-commit-config-local.yaml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,35 @@ repos:
7878
hooks:
7979
- id: clang-format
8080
args: [--style=file]
81+
- repo: local
82+
hooks:
83+
- id: ament_cppcheck
84+
name: ament_cppcheck
85+
description: Static code analysis of C/C++ files.
86+
entry: env AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS=1 ament_cppcheck
87+
language: system
88+
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
89+
- repo: local
90+
hooks:
91+
- id: ament_cpplint
92+
name: ament_cpplint
93+
description: Static code analysis of C/C++ files.
94+
entry: ament_cpplint
95+
language: system
96+
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
97+
args: [
98+
"--linelength=100",
99+
"--filter=-whitespace/newline,-legal/copyright,-build/include_order"
100+
]
101+
# CMake hooks
102+
- repo: local
103+
hooks:
104+
- id: ament_lint_cmake
105+
name: ament_lint_cmake
106+
description: Check format of CMakeLists.txt files.
107+
entry: ament_lint_cmake
108+
language: system
109+
files: CMakeLists\.txt$
81110
# Spellcheck in comments and docs
82111
- repo: https://github.com/codespell-project/codespell
83112
rev: v2.4.1

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Image Filtering Node
22
[![Industrial CI](https://github.com/vortexntnu/vortex-image-filtering/actions/workflows/industrial-ci.yml/badge.svg)](https://github.com/vortexntnu/vortex-image-filtering/actions/workflows/industrial-ci.yml)
3-
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/vortexntnu/vortex-image-filtering/main.svg)](https://results.pre-commit.ci/latest/github/vortexntnu/vortex-image-filtering/main)
43
[![codecov](https://codecov.io/github/vortexntnu/vortex-image-filtering/graph/badge.svg?token=6XHprkpUsR)](https://codecov.io/github/vortexntnu/vortex-image-filtering)
54

65
The `image_filtering_node` is a ROS 2 node developed in the `vortex::image_filters` namespace. It is designed to subscribe to image topics, apply various image filters using OpenCV, and publish the filtered images back to ROS.

0 commit comments

Comments
 (0)