From 6abb6b549bcd5ef45088f9cd88a3daf07dace1d2 Mon Sep 17 00:00:00 2001 From: Bjar Ne Date: Fri, 29 Jan 2021 00:15:55 +0000 Subject: [PATCH] Enable Linters on Eigen, geometry_msgs and KDL --- tf2_eigen/CMakeLists.txt | 12 ++++++++++++ tf2_eigen/package.xml | 2 ++ tf2_geometry_msgs/CMakeLists.txt | 11 +++++++++++ tf2_geometry_msgs/package.xml | 2 ++ tf2_kdl/CMakeLists.txt | 12 ++++++++++-- tf2_kdl/package.xml | 2 ++ 6 files changed, 39 insertions(+), 2 deletions(-) diff --git a/tf2_eigen/CMakeLists.txt b/tf2_eigen/CMakeLists.txt index 2060c9e8d..33c67b9bc 100644 --- a/tf2_eigen/CMakeLists.txt +++ b/tf2_eigen/CMakeLists.txt @@ -22,6 +22,18 @@ install(DIRECTORY include/${PROJECT_NAME}/ if(BUILD_TESTING) find_package(ament_cmake_gtest REQUIRED) + list(APPEND AMENT_LINT_AUTO_EXCLUDE + ament_cmake_cppcheck + ament_cmake_uncrustify + ament_cmake_copyright + ) + find_package(ament_lint_auto REQUIRED) + find_package(ament_cmake_uncrustify REQUIRED) + find_package(ament_cmake_cppcheck REQUIRED) + ament_lint_auto_find_test_dependencies() + ament_cppcheck(LANGUAGE "c++") + ament_uncrustify(LANGUAGE "c++") + ament_add_gtest(tf2_eigen-test test/tf2_eigen-test.cpp) if(TARGET tf2_eigen-test) target_include_directories(tf2_eigen-test PUBLIC diff --git a/tf2_eigen/package.xml b/tf2_eigen/package.xml index 6c79b26ac..89a9c49d9 100644 --- a/tf2_eigen/package.xml +++ b/tf2_eigen/package.xml @@ -23,6 +23,8 @@ ament_cmake_gtest eigen + ament_lint_auto + ament_lint_common ament_cmake diff --git a/tf2_geometry_msgs/CMakeLists.txt b/tf2_geometry_msgs/CMakeLists.txt index 7d5fd6db7..b6d1429f7 100644 --- a/tf2_geometry_msgs/CMakeLists.txt +++ b/tf2_geometry_msgs/CMakeLists.txt @@ -30,6 +30,17 @@ ament_auto_find_build_dependencies(REQUIRED ${required_dependencies}) if(BUILD_TESTING) find_package(ament_cmake_gtest REQUIRED) find_package(rclcpp REQUIRED) + + find_package(ament_cmake_cppcheck REQUIRED) + find_package(ament_cmake_cpplint REQUIRED) + find_package(ament_cmake_lint_cmake REQUIRED) + find_package(ament_cmake_uncrustify REQUIRED) + + ament_cppcheck(LANGUAGE "c++") + ament_cpplint() + ament_lint_cmake() + ament_uncrustify(LANGUAGE "c++") + ament_add_gtest(test_tf2_geometry_msgs test/test_tf2_geometry_msgs.cpp) if(TARGET test_tf2_geometry_msgs) target_include_directories(test_tf2_geometry_msgs PUBLIC include) diff --git a/tf2_geometry_msgs/package.xml b/tf2_geometry_msgs/package.xml index ec7f6fe2d..99e6dc5d6 100644 --- a/tf2_geometry_msgs/package.xml +++ b/tf2_geometry_msgs/package.xml @@ -27,6 +27,8 @@ tf2_ros_py ament_cmake_gtest + ament_lint_auto + ament_lint_common rclcpp diff --git a/tf2_kdl/CMakeLists.txt b/tf2_kdl/CMakeLists.txt index c9934979a..3a058600f 100644 --- a/tf2_kdl/CMakeLists.txt +++ b/tf2_kdl/CMakeLists.txt @@ -18,10 +18,10 @@ find_package(tf2 REQUIRED) find_package(tf2_ros REQUIRED) ament_python_install_package(${PROJECT_NAME} - PACKAGE_DIR src/${PROJECT_NAME}) + PACKAGE_DIR src/${PROJECT_NAME}) install(DIRECTORY include/${PROJECT_NAME}/ - DESTINATION include/${PROJECT_NAME} + DESTINATION include/${PROJECT_NAME} ) # TODO(ahcorde): Port python once https://github.com/ros2/orocos_kinematics_dynamics/pull/4 is merged @@ -34,6 +34,14 @@ if(BUILD_TESTING) find_package(rclcpp REQUIRED) find_package(tf2_msgs REQUIRED) + find_package(ament_cmake_cppcheck REQUIRED) + find_package(ament_cmake_cpplint REQUIRED) + find_package(ament_cmake_lint_cmake REQUIRED) + find_package(ament_cmake_uncrustify REQUIRED) + + ament_cppcheck(LANGUAGE "c++") + ament_uncrustify(LANGUAGE "c++") + ament_add_gtest(test_kdl test/test_tf2_kdl.cpp) target_include_directories(test_kdl PUBLIC include diff --git a/tf2_kdl/package.xml b/tf2_kdl/package.xml index f0b105579..e4530097f 100644 --- a/tf2_kdl/package.xml +++ b/tf2_kdl/package.xml @@ -22,6 +22,8 @@ tf2_ros_py ament_cmake_gtest + ament_lint_auto + ament_lint_common rclcpp tf2_msgs