Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9f90814
ignore: Test installing clang-tidy and build for compile_commands.jso…
aria-wong Jan 8, 2026
3406f56
ignore: Install ROS2 and colcon in C++ linting dependency job
aria-wong Jan 8, 2026
be7499f
ignore: Add ROS2 repository before installing dependencies
aria-wong Jan 8, 2026
6d7146a
ignore: Install colcon
aria-wong Jan 8, 2026
a1cb3d6
ignore: Try installing ROS humble base
aria-wong Jan 8, 2026
b907c56
ignore: Changed host from ubuntu-latest to ubuntu-22.04
aria-wong Jan 8, 2026
6eeb069
ignore: Initialize rosdeps
aria-wong Jan 8, 2026
9f430e1
ignore: Install colcon manually
aria-wong Jan 8, 2026
903f9ef
ignore: Source ROS2 setup file
aria-wong Jan 8, 2026
7a58b01
ignore: Install ament cmake manually
aria-wong Jan 10, 2026
d824a3e
ignore: rosdep install
aria-wong Jan 10, 2026
446c300
ignore: source setup.bash after using rosdep
aria-wong Jan 10, 2026
84d5079
ignore: Remove rosdep install line
aria-wong Jan 10, 2026
03d88b5
ignore: Fix build.sh not running
aria-wong Jan 10, 2026
e312faa
ignore: Only configure CMake
aria-wong Jan 11, 2026
3a65ddd
ignore: Install desktop version of ROS2 instead of base
aria-wong Jan 11, 2026
067841c
ignore: Install correct ROS2 package and upgrade CMake
aria-wong Jan 11, 2026
901d52f
ignore: Use CPRT Docker image to configure
aria-wong Jan 11, 2026
0f9a05c
ignore: Install zed
aria-wong Jan 11, 2026
2b5851d
ignore: Source setup.bash before rosdep
aria-wong Jan 11, 2026
607943a
ignore: Install rest of missing dependencies
aria-wong Jan 11, 2026
479521b
ignore: Install eigen3
aria-wong Jan 11, 2026
a37badc
ignore: Install kindr and zed after smaller dependencies
aria-wong Jan 11, 2026
02d49e3
ignore: sudo make install in kindr install
aria-wong Jan 11, 2026
5c7287e
feat: Script for running clang-tidy on each project
aria-wong Jan 18, 2026
a6a5153
feat: Modified linting script to exclude third-party projects
aria-wong Jan 20, 2026
e11dbf1
minor: Cleaned up linting-cpp.sh
aria-wong Jan 21, 2026
8846405
minor: Add clang-tidy and jq dependencies, and minor changes to linti…
aria-wong Jan 23, 2026
2e2550c
minor: Change lint-and-format image back to ubuntu-latest
aria-wong Jan 24, 2026
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
5 changes: 5 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
Checks: "clang-analyzer-core-*"
WarningsAsErrors: ''
FormatStyle: none
HeaderFilterRegex: '^(?!/opt/ros/|/usr/).*'
2 changes: 1 addition & 1 deletion .github/workflows/lint-and-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
find ./src \
-path ./src/third-party -prune -o \
\( -name "*.h" -o -name "*.hpp" -o -name "*.cpp" \) -print \
| xargs clang-format --dry-run --Werror
| xargs clang-format --dry-run --Werror
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ FROM runtime AS dev
RUN apt-get update && apt-get install -y --no-install-recommends \
git x11-apps ros-humble-desktop ros-dev-tools black pylint \
ros-humble-ament-cmake python3-colcon-common-extensions \
python3-colcon-ros clang-format cuda-compiler-12-6 \
python3-colcon-ros clang-format clang-tidy jq cuda-compiler-12-6 \
cuda-cudart-dev-12-6 cuda-driver-dev-12-6 libpng-dev ccache \
libc6-dev libssl-dev cuda-toolkit-12-6 libnvinfer10 \
libnvinfer-plugin10 libnvonnxparsers10 \
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ find ./src -path ./src/third-party -prune -o \

rosdep install --from-paths src -i -r -y

colcon build --symlink-install --continue-on-error --cmake-args=-DCMAKE_BUILD_TYPE=Release --parallel-workers $(nproc)
colcon build --symlink-install --continue-on-error --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON --parallel-workers $(nproc)
35 changes: 35 additions & 0 deletions linting-cpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# To use this script:
# 1. Add the names of the projects you want to exclude to excludedProjects
# 2. Run the script: ./linting-cpp.sh
# Note: This script must be in the root directory because of build.sh

# Additional checks can be added to the .clang-tidy file

# List of excluded projects
excludedProjects=("third-party" "elevation_mapping" "interfaces" "kindr_msgs"
"kindr_ros" "ouster_ros" "ouster_sensor_msgs" "ublox"
"ublox_gps" "ublox_msgs" "ublox_serialization"
"zed_components" "zed_ros2" "zed_wrapper")

rootPath=$(pwd)

# Run build script to generate compile_commands.json for each CMake project
./build.sh

excludedProjectsArgs=()

# Format the excluded projects into an argument list that is read by find
for excludedProject in "${excludedProjects[@]}"; do
excludedProjectsArgs+=("-not" "-path" "*/$excludedProject/*")
done

# Concatenate all compile_commands.json files into one file
find build -name compile_commands.json -exec jq '.[]' {} + \
| jq -s '.' > build/compile_commands.json

# Run clang-tidy
# The find command filters the excluded projects out
# All .cpp files in the included projects are linted (header files are also implicitly linted when included in a source file)
run-clang-tidy -p build $(find src -type f -name "*.cpp" "${excludedProjectsArgs[@]}") -extra-arg-before=-std=c++17 -j $(nproc)
Loading