Skip to content

Instantly share code, notes, and snippets.

@mitsudome-r
Last active February 5, 2026 12:04
Show Gist options
  • Select an option

  • Save mitsudome-r/d39420c46391c5bb3718b375811f30d1 to your computer and use it in GitHub Desktop.

Select an option

Save mitsudome-r/d39420c46391c5bb3718b375811f30d1 to your computer and use it in GitHub Desktop.
Running Jazzy clang-tidy locally
  1. Build Autoware Core
#set up colcon workspace
git clone https:github.com/autowarefoundation/autoware.git
cd autoware
vcs import src/ < repositories/autoware.repos
vcs import src/ < repositories/autoware-nightly.repos

# run docker
docker run -it --rm --name jazzy -v $HOME/autoware:/autoware_jazzy  ghcr.io/autowarefoundation/autoware:core-common-devel-jazzy-amd64 /bin/bash

# install dependencies
cd /autoware_jazzy
apt update
source /opt/ros/jazzy/setup.bash
rosdep update
rosdep install -yr --from-paths src/core/ --ignore-src --rosdistro $ROS_DISTRO

# get autoware core packages list
autoware_core_pkgs=$(colcon list --base-paths src/core/autoware_core -n | awk '{printf "%s ", $1}')

# build autoware core packages
colcon build --symlink-install --event-handlers=console_cohesion+ --packages-up-to ${autoware_core_pkgs} --continue-on-error --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
  1. Run Clang-tidy
apt update
apt install clang-tidy libomp-dev

mkdir -p /tmp/clang-tidy-result
ln -s src/core/autoware_core/.clang-tidy ./clang-tidy
run-clang-tidy -quiet -p build/ -export-fixes /tmp/clang-tidy-result/fixes.yaml ${autoware_core_pkgs} 2> >(tee -a /tmp/clang-tidy-result/report.log >&2)
  1. Parse fix.yaml and extract errors
apt update
apt install yq
yq '.Diagnostics[] | select(.Level == "Error")' /tmp/clang-tidy-result/fixes.yaml > errors_only.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment