Skip to content

Commit 54caaa7

Browse files
committed
refactor: merge the two pre-commit files to replace the pre-commit-ci bot
1 parent 19a8d11 commit 54caaa7

4 files changed

Lines changed: 31 additions & 49 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
uses: vortexntnu/vortex-ci/.github/workflows/reusable-pre-commit.yml@main
1313
with:
1414
ros_distro: 'humble'
15-
config_path: '.pre-commit-config-local.yaml'
15+
config_path: '.pre-commit-config.yaml'

.pre-commit-config-local.yaml

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

.pre-commit-config.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,36 @@ repos:
7474
hooks:
7575
- id: clang-format
7676
args: [--style=file]
77+
- repo: local
78+
hooks:
79+
- id: ament_cppcheck
80+
name: ament_cppcheck
81+
description: Static code analysis of C/C++ files.
82+
entry: env AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS=1 ament_cppcheck
83+
language: system
84+
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
85+
exclude: (^|/)(test|tests)/.* # exclude test dirs since ament_cppcheck misparses GTest macros and throws false syntax errors
86+
- repo: local
87+
hooks:
88+
- id: ament_cpplint
89+
name: ament_cpplint
90+
description: Static code analysis of C/C++ files.
91+
entry: ament_cpplint
92+
language: system
93+
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
94+
args: [
95+
"--linelength=120",
96+
"--filter=-whitespace/newline,-legal/copyright,-build/include_order" # ignore build/include_order since it conflicts with .clang-format
97+
]
98+
# CMake hooks
99+
- repo: local
100+
hooks:
101+
- id: ament_lint_cmake
102+
name: ament_lint_cmake
103+
description: Check format of CMakeLists.txt files.
104+
entry: ament_lint_cmake
105+
language: system
106+
files: CMakeLists\.txt$
77107
# Spellcheck in comments and docs
78108
- repo: https://github.com/codespell-project/codespell
79109
rev: v2.4.1

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
[![Industrial CI](https://github.com/vortexntnu/vortex-auv/actions/workflows/industrial-ci.yml/badge.svg)](https://github.com/vortexntnu/vortex-auv/actions/workflows/industrial-ci.yml)
33
[![Simulator Test](https://github.com/vortexntnu/vortex-auv/actions/workflows/simulator-test.yml/badge.svg)](https://github.com/vortexntnu/vortex-auv/actions/workflows/simulator-test.yml)
44
[![ROS Node Test](https://github.com/vortexntnu/vortex-auv/actions/workflows/ros-node-tests.yml/badge.svg)](https://github.com/vortexntnu/vortex-auv/actions/workflows/ros-node-tests.yml)
5-
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/vortexntnu/vortex-auv/main.svg)](https://results.pre-commit.ci/latest/github/vortexntnu/vortex-auv/main)
65
[![pre-commit](https://github.com/vortexntnu/vortex-auv/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/vortexntnu/vortex-auv/actions/workflows/pre-commit.yml)
76
[![codecov](https://codecov.io/github/vortexntnu/vortex-auv/graph/badge.svg?token=UXIGc2qG7N)](https://codecov.io/github/vortexntnu/vortex-auv)
87

0 commit comments

Comments
 (0)