Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: pre-commit

on:
pull_request:
workflow_dispatch:
jobs:
call_reusable_workflow:
uses: vortexntnu/vortex-ci/.github/workflows/reusable-pre-commit.yml@main
with:
ros_distro: 'humble'
config_path: '.pre-commit-config-local.yaml'
43 changes: 43 additions & 0 deletions .pre-commit-config-local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# To use:
#
# pre-commit run --all-files -c .pre-commit-config-local.yaml
#
# Or to install it for automatic checks on commit:
#
# pre-commit install -c .pre-commit-config-local.yaml
#
# To update this file:
#
# pre-commit autoupdate -c .pre-commit-config-local.yaml
#
# See https://pre-commit.com/ for documentation
#
# NOTE: This configuration uses local hooks specific to ROS2 (ament_* linters)

repos:
- repo: local
hooks:
- id: ament_cppcheck
name: ament_cppcheck
description: Static code analysis of C/C++ files.
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)$
- repo: local
hooks:
- id: ament_cpplint
name: ament_cpplint
description: Static code analysis of C/C++ files.
entry: ament_cpplint
language: system
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
args: ["--linelength=100", "--filter=-whitespace/newline,-legal/copyright"]
# CMake hooks
- repo: local
hooks:
- id: ament_lint_cmake
name: ament_lint_cmake
description: Check format of CMakeLists.txt files.
entry: ament_lint_cmake
language: system
files: CMakeLists\.txt$
Loading