ament_cmake_clang_tidy
Diagnose and fix typical programming errors with Clang-Tidy.
Files with the following extensions are being considered:
.c
, .cc
, .cpp
, .cxx
, .h
, .hh
, .hpp
, .hxx
.
How to run the check from the command line?
The command line tool is provided by the package ament_clang_tidy.
How to run the check from within a CMake ament package as part of the tests?
package.xml
:
<buildtool_depend>ament_cmake</buildtool_depend>
<test_depend>ament_clang_tidy</test_depend>
CMakeLists.txt
:
find_package(ament_cmake REQUIRED)
if(BUILD_TESTING)
find_package(ament_cmake_clang_tidy REQUIRED)
ament_clang_tidy(${CMAKE_BINARY_DIR})
endif()
When running multiple linters as part of the CMake tests the documentation of the package ament_lint_auto might contain some useful information.
The documentation of the package ament_cmake_test provides more information on testing in CMake ament packages.