From 97ead9953bb44b9f6a727f1b3630d78f4daef3ab Mon Sep 17 00:00:00 2001 From: "Y.Hisaki" Date: Thu, 3 Oct 2024 16:01:49 +0900 Subject: [PATCH 01/12] modify clang-tidy to run only on specified packages Signed-off-by: Y.Hisaki --- .../build-and-test-differential.yaml | 13 +- clang-tidy-required-packages.yaml | 223 ++++++++++++++++++ 2 files changed, 230 insertions(+), 6 deletions(-) create mode 100644 clang-tidy-required-packages.yaml diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 5e1f3e2c093a5..56a75d901ad91 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -97,20 +97,21 @@ jobs: id: get-modified-packages uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1 - - name: Get changed files (existing files only) - id: get-changed-files + - name: Get target packages + id: get-target-packages run: | - echo "changed-files=$(git diff --name-only "origin/${{ github.base_ref }}"...HEAD | grep -E '\.(cpp|hpp)$' | while read -r file; do [ -e "$file" ] && echo -n "$file "; done)" >> $GITHUB_OUTPUT + sudo snap install yq + PACKAGES=$(yq e '.[]' clang-tidy-required-packages.yaml | grep -Fxf - <(echo "${{ steps.get-modified-packages.outputs.modified-packages }}" | tr ' ' '\n') | xargs) + echo "target-packages=${PACKAGES}" >> $GITHUB_OUTPUT shell: bash - name: Run clang-tidy - if: ${{ steps.get-changed-files.outputs.changed-files != '' }} + if: ${{ steps.get-target-packages.outputs.target-packages != '' }} uses: autowarefoundation/autoware-github-actions/clang-tidy@v1 with: rosdistro: humble - target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }} - target-files: ${{ steps.get-changed-files.outputs.changed-files }} clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy-ci + target-packages: ${{ steps.get-target-packages.outputs.target-packages }} build-depends-repos: build_depends.repos cache-key-element: cuda diff --git a/clang-tidy-required-packages.yaml b/clang-tidy-required-packages.yaml new file mode 100644 index 0000000000000..0576be9861dc3 --- /dev/null +++ b/clang-tidy-required-packages.yaml @@ -0,0 +1,223 @@ +##### common ##### +# - autoware_ad_api_specs +# - autoware_auto_common +# - autoware_geography_utils +# - autoware_grid_map_utils +# - autoware_interpolation +# - autoware_kalman_filter +# - autoware_mission_details_overlay_rviz_plugin +# - autoware_motion_utils +# - autoware_overlay_rviz_plugin +# - autoware_path_distance_calculator +# - autoware_perception_rviz_plugin +# - autoware_point_types +# - autoware_signal_processing +# - autoware_test_utils +# - autoware_testing +- autoware_universe_utils +# - autoware_vehicle_info_utils +# - bag_time_manager_rviz_plugin +# - component_interface_specs +# - component_interface_tools +# - component_interface_utils +# - fake_test_node +# - global_parameter_loader +# - glog_component +# - goal_distance_calculator +# - object_recognition_utils +# - osqp_interface +# - polar_grid +# - qp_interface +# - tensorrt_common +# - tier4_adapi_rviz_plugin +# - tier4_api_utils +# - tier4_camera_view_rviz_plugin +# - tier4_datetime_rviz_plugin +# - tier4_localization_rviz_plugin +# - tier4_planning_rviz_plugin +# - tier4_state_rviz_plugin +# - tier4_system_rviz_plugin +# - tier4_traffic_light_rviz_plugin +# - tier4_vehicle_rviz_plugin +# - time_utils +# - traffic_light_recognition_marker_publisher +# - traffic_light_utils +# - tvm_utility +##### control ##### +# - autoware_autonomous_emergency_braking +# - autoware_control_validator +# - autoware_external_cmd_selector +# - autoware_joy_controller +# - autoware_lane_departure_checker +# - autoware_mpc_lateral_controller +# - autoware_operation_mode_transition_manager +# - autoware_pid_longitudinal_controller +# - autoware_pure_pursuit +# - autoware_shift_decider +# - autoware_smart_mpc_trajectory_follower +# - autoware_trajectory_follower_base +# - autoware_trajectory_follower_node +# - autoware_vehicle_cmd_gate +# - control_performance_analysis +# - obstacle_collision_checker +# - predicted_path_checker +##### evaluator ##### +# - autoware_control_evaluator +# - autoware_evaluator_utils +# - autoware_planning_evaluator +# - diagnostic_converter +# - kinematic_evaluator +# - localization_evaluator +# - perception_online_evaluator +##### map ##### +# - autoware_map_height_fitter +# - autoware_map_projection_loader +# - autoware_map_tf_generator +# - map_loader +##### perception ##### +# - autoware_bytetrack +# - autoware_cluster_merger +# - autoware_compare_map_segmentation +# - autoware_crosswalk_traffic_light_estimator +# - autoware_detected_object_feature_remover +# - autoware_detected_object_validation +# - autoware_detection_by_tracker +# - autoware_elevation_map_loader +# - autoware_euclidean_cluster +# - autoware_ground_segmentation +# - autoware_image_projection_based_fusion +# - autoware_lidar_apollo_instance_segmentation +# - autoware_lidar_centerpoint +# - autoware_lidar_transfusion +# - autoware_map_based_prediction +# - autoware_multi_object_tracker +# - autoware_object_merger +# - autoware_object_range_splitter +# - autoware_object_velocity_splitter +# - autoware_occupancy_grid_map_outlier_filter +# - autoware_probabilistic_occupancy_grid_map +# - autoware_radar_crossing_objects_noise_filter +# - autoware_radar_fusion_to_detected_object +# - autoware_radar_object_clustering +# - autoware_radar_object_tracker +# - autoware_radar_tracks_msgs_converter +# - autoware_raindrop_cluster_filter +# - autoware_shape_estimation +# - autoware_simple_object_merger +# - autoware_tensorrt_classifier +# - autoware_tensorrt_yolox +# - autoware_tracking_object_merger +# - autoware_traffic_light_arbiter +# - autoware_traffic_light_classifier +# - autoware_traffic_light_fine_detector +# - autoware_traffic_light_map_based_detector +# - autoware_traffic_light_multi_camera_fusion +# - autoware_traffic_light_occlusion_predictor +# - autoware_traffic_light_visualization +# - perception_utils +##### planning ##### +# - autoware_behavior_path_avoidance_by_lane_change_module +# - autoware_behavior_path_dynamic_obstacle_avoidance_module +# - autoware_behavior_path_external_request_lane_change_module +# - autoware_behavior_path_goal_planner_module +# - autoware_behavior_path_lane_change_module +# - autoware_behavior_path_planner +# - autoware_behavior_path_planner_common +# - autoware_behavior_path_sampling_planner_module +# - autoware_behavior_path_side_shift_module +# - autoware_behavior_path_start_planner_module +# - autoware_behavior_path_static_obstacle_avoidance_module +# - autoware_behavior_velocity_blind_spot_module +# - autoware_behavior_velocity_crosswalk_module +# - autoware_behavior_velocity_detection_area_module +# - autoware_behavior_velocity_intersection_module +# - autoware_behavior_velocity_no_drivable_lane_module +# - autoware_behavior_velocity_no_stopping_area_module +# - autoware_behavior_velocity_occlusion_spot_module +# - autoware_behavior_velocity_planner +# - autoware_behavior_velocity_planner_common +# - autoware_behavior_velocity_run_out_module +# - autoware_behavior_velocity_speed_bump_module +# - autoware_behavior_velocity_stop_line_module +# - autoware_behavior_velocity_template_module +# - autoware_behavior_velocity_traffic_light_module +# - autoware_behavior_velocity_virtual_traffic_light_module +# - autoware_behavior_velocity_walkway_module +# - autoware_bezier_sampler +# - autoware_costmap_generator +# - autoware_external_velocity_limit_selector +# - autoware_freespace_planner +# - autoware_freespace_planning_algorithms +# - autoware_frenet_planner +# - autoware_mission_planner +# - autoware_motion_velocity_dynamic_obstacle_stop_module +# - autoware_motion_velocity_obstacle_velocity_limiter_module +# - autoware_motion_velocity_out_of_lane_module +# - autoware_motion_velocity_planner_common +# - autoware_motion_velocity_planner_node +# - autoware_objects_of_interest_marker_interface +# - autoware_obstacle_cruise_planner +# - autoware_obstacle_stop_planner +# - autoware_path_optimizer +# - autoware_path_sampler +# - autoware_path_smoother +# - autoware_planning_test_manager +# - autoware_planning_topic_converter +# - autoware_planning_validator +# - autoware_remaining_distance_time_calculator +# - autoware_route_handler +# - autoware_rtc_interface +# - autoware_sampler_common +# - autoware_scenario_selector +# - autoware_static_centerline_generator +# - autoware_surround_obstacle_checker +# - autoware_velocity_smoother +##### sensing ##### +# - autoware_gnss_poser +# - autoware_image_diagnostics +# - autoware_image_transport_decompressor +# - autoware_imu_corrector +# - autoware_livox_tag_filter +# - autoware_pcl_extensions +# - autoware_pointcloud_preprocessor +# - autoware_radar_scan_to_pointcloud2 +# - autoware_radar_static_pointcloud_filter +# - autoware_radar_threshold_filter +# - autoware_radar_tracks_noise_filter +# - cuda_utils +# - vehicle_velocity_converter +##### simulator ##### +# - autoware_carla_interface +# - dummy_perception_publisher +# - fault_injection +# - learning_based_vehicle_model +# - simple_planning_simulator +# - tier4_dummy_object_rviz_plugin +# - vehicle_door_simulator +##### system ##### +# - ad_api_adaptors +# - ad_api_visualizers +# - automatic_pose_initializer +# - autoware_component_monitor +# - autoware_default_adapi +# - autoware_processing_time_checker +# - bluetooth_monitor +# - component_state_monitor +# - diagnostic_graph_aggregator +# - diagnostic_graph_utils +# - dummy_diag_publisher +# - dummy_infrastructure +# - duplicated_node_checker +# - hazard_status_converter +# - mrm_comfortable_stop_operator +# - mrm_emergency_stop_operator +# - mrm_handler +# - system_diagnostic_monitor +# - system_monitor +# - topic_state_monitor +# - velodyne_monitor +##### vehicle ##### +# - autoware_accel_brake_map_calibrator +# - autoware_external_cmd_converter +- autoware_raw_vehicle_cmd_converter +# - autoware_steer_offset_estimator From 9f81ef09b1151bf904fa0bc459f914501270570d Mon Sep 17 00:00:00 2001 From: "Y.Hisaki" Date: Mon, 7 Oct 2024 19:21:36 +0900 Subject: [PATCH 02/12] update Signed-off-by: Y.Hisaki --- .github/workflows/build-and-test-differential.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index 56a75d901ad91..eab800e6e5550 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -107,7 +107,7 @@ jobs: - name: Run clang-tidy if: ${{ steps.get-target-packages.outputs.target-packages != '' }} - uses: autowarefoundation/autoware-github-actions/clang-tidy@v1 + uses: yhisaki/autoware-github-actions/clang-tidy@use-ament_clang_tidy with: rosdistro: humble clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy-ci From a0bda4595cf2b6bfdd33f30c3d72665c0f3e3741 Mon Sep 17 00:00:00 2001 From: "Y.Hisaki" Date: Mon, 7 Oct 2024 19:22:30 +0900 Subject: [PATCH 03/12] change raw_vehicle_cmd_converter Signed-off-by: Y.Hisaki --- vehicle/autoware_raw_vehicle_cmd_converter/src/vgr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/vehicle/autoware_raw_vehicle_cmd_converter/src/vgr.cpp b/vehicle/autoware_raw_vehicle_cmd_converter/src/vgr.cpp index 13463d1678ac8..6ff51ab1a0888 100644 --- a/vehicle/autoware_raw_vehicle_cmd_converter/src/vgr.cpp +++ b/vehicle/autoware_raw_vehicle_cmd_converter/src/vgr.cpp @@ -22,6 +22,7 @@ namespace autoware::raw_vehicle_cmd_converter void VGR::setCoefficients(const double a, const double b, const double c) { + // Hi! I'm a comment! vgr_coef_a_ = a; vgr_coef_b_ = b; vgr_coef_c_ = c; From d2dea8be8164b9870bf594d68f8e53bed42ac61c Mon Sep 17 00:00:00 2001 From: "Y.Hisaki" Date: Mon, 7 Oct 2024 20:28:44 +0900 Subject: [PATCH 04/12] fix Signed-off-by: Y.Hisaki --- .github/workflows/build-and-test-differential.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test-differential.yaml b/.github/workflows/build-and-test-differential.yaml index eab800e6e5550..6706ce71f5bb9 100644 --- a/.github/workflows/build-and-test-differential.yaml +++ b/.github/workflows/build-and-test-differential.yaml @@ -97,11 +97,18 @@ jobs: id: get-modified-packages uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1 + - name: Get required packages + id: get-required-packages + uses: mikefarah/yq@master + with: + cmd: yq '.[]' clang-tidy-required-packages.yaml + - name: Get target packages id: get-target-packages run: | - sudo snap install yq - PACKAGES=$(yq e '.[]' clang-tidy-required-packages.yaml | grep -Fxf - <(echo "${{ steps.get-modified-packages.outputs.modified-packages }}" | tr ' ' '\n') | xargs) + echo "${{ steps.get-required-packages.outputs.result }}" > required_packages.txt + echo "${{ steps.get-modified-packages.outputs.modified-packages }}" | tr ' ' '\n' > modified_packages.txt + PACKAGES=$(grep -Fxf required_packages.txt modified_packages.txt | xargs) echo "target-packages=${PACKAGES}" >> $GITHUB_OUTPUT shell: bash From 7496927d1d82ddfd1bab9bacd0645af16c07a5b7 Mon Sep 17 00:00:00 2001 From: "Y.Hisaki" Date: Tue, 8 Oct 2024 11:47:48 +0900 Subject: [PATCH 05/12] add map_loader to clang-tidy-requred Signed-off-by: Y.Hisaki --- clang-tidy-required-packages.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang-tidy-required-packages.yaml b/clang-tidy-required-packages.yaml index 0576be9861dc3..19e079c9facd3 100644 --- a/clang-tidy-required-packages.yaml +++ b/clang-tidy-required-packages.yaml @@ -73,7 +73,7 @@ # - autoware_map_height_fitter # - autoware_map_projection_loader # - autoware_map_tf_generator -# - map_loader +- map_loader ##### perception ##### # - autoware_bytetrack # - autoware_cluster_merger From ce2dda4c3643d199b5be45deae26f3b4dcd7cd5f Mon Sep 17 00:00:00 2001 From: "Y.Hisaki" Date: Tue, 8 Oct 2024 15:41:52 +0900 Subject: [PATCH 06/12] change map_loader Signed-off-by: Y.Hisaki --- map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp b/map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp index e38d65201ee56..21eb5bb25fdcd 100644 --- a/map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp +++ b/map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp @@ -28,6 +28,8 @@ #include #include + +// Hi! I'm a comment! class Lanelet2MapLoaderNode : public rclcpp::Node { public: From 92dd41656d73265d3b9c651579f7b6106ae49a6c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 06:44:26 +0000 Subject: [PATCH 07/12] style(pre-commit): autofix --- map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp b/map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp index 21eb5bb25fdcd..db3dae862d7b4 100644 --- a/map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp +++ b/map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp @@ -28,7 +28,6 @@ #include #include - // Hi! I'm a comment! class Lanelet2MapLoaderNode : public rclcpp::Node { From 64caa8b495e2804448f1804d7d92e90bb37cf6a5 Mon Sep 17 00:00:00 2001 From: "Y.Hisaki" Date: Tue, 8 Oct 2024 16:55:45 +0900 Subject: [PATCH 08/12] change interrsection Signed-off-by: Y.Hisaki --- clang-tidy-required-packages.yaml | 2 +- .../src/scene_intersection.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/clang-tidy-required-packages.yaml b/clang-tidy-required-packages.yaml index 19e079c9facd3..0431051d73fa3 100644 --- a/clang-tidy-required-packages.yaml +++ b/clang-tidy-required-packages.yaml @@ -130,7 +130,7 @@ # - autoware_behavior_velocity_blind_spot_module # - autoware_behavior_velocity_crosswalk_module # - autoware_behavior_velocity_detection_area_module -# - autoware_behavior_velocity_intersection_module +- autoware_behavior_velocity_intersection_module # - autoware_behavior_velocity_no_drivable_lane_module # - autoware_behavior_velocity_no_stopping_area_module # - autoware_behavior_velocity_occlusion_spot_module diff --git a/planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.cpp b/planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.cpp index 9f6935e6d7e7b..7d5eb13a76dfd 100644 --- a/planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.cpp +++ b/planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.cpp @@ -38,6 +38,8 @@ #include #include + +// Hi! I'm a comment! namespace autoware::behavior_velocity_planner { namespace bg = boost::geometry; From 276c91ab77cc65f3f15ae755cb809476e597b53c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 07:59:19 +0000 Subject: [PATCH 09/12] style(pre-commit): autofix --- .../src/scene_intersection.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.cpp b/planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.cpp index 7d5eb13a76dfd..f3a1b11ec2164 100644 --- a/planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.cpp +++ b/planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.cpp @@ -38,7 +38,6 @@ #include #include - // Hi! I'm a comment! namespace autoware::behavior_velocity_planner { From cdad389ee089384d108d68eba0bfd29ffea512c1 Mon Sep 17 00:00:00 2001 From: "Y.Hisaki" Date: Tue, 8 Oct 2024 18:09:47 +0900 Subject: [PATCH 10/12] Revert "change raw_vehicle_cmd_converter" This reverts commit a0bda4595cf2b6bfdd33f30c3d72665c0f3e3741. --- vehicle/autoware_raw_vehicle_cmd_converter/src/vgr.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/vehicle/autoware_raw_vehicle_cmd_converter/src/vgr.cpp b/vehicle/autoware_raw_vehicle_cmd_converter/src/vgr.cpp index 6ff51ab1a0888..13463d1678ac8 100644 --- a/vehicle/autoware_raw_vehicle_cmd_converter/src/vgr.cpp +++ b/vehicle/autoware_raw_vehicle_cmd_converter/src/vgr.cpp @@ -22,7 +22,6 @@ namespace autoware::raw_vehicle_cmd_converter void VGR::setCoefficients(const double a, const double b, const double c) { - // Hi! I'm a comment! vgr_coef_a_ = a; vgr_coef_b_ = b; vgr_coef_c_ = c; From 2d00ace39212d30549f2560a49157531f28d95cf Mon Sep 17 00:00:00 2001 From: "Y.Hisaki" Date: Tue, 8 Oct 2024 18:10:28 +0900 Subject: [PATCH 11/12] Revert "change map_loader" This reverts commit ce2dda4c3643d199b5be45deae26f3b4dcd7cd5f. Signed-off-by: Y.Hisaki --- map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp b/map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp index db3dae862d7b4..e38d65201ee56 100644 --- a/map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp +++ b/map/map_loader/include/map_loader/lanelet2_map_loader_node.hpp @@ -28,7 +28,6 @@ #include #include -// Hi! I'm a comment! class Lanelet2MapLoaderNode : public rclcpp::Node { public: From 60b0cf3690f6de59d1e4f807db8932ae39027d0b Mon Sep 17 00:00:00 2001 From: "Y.Hisaki" Date: Tue, 8 Oct 2024 18:11:53 +0900 Subject: [PATCH 12/12] Revert "change interrsection" This reverts commit 64caa8b495e2804448f1804d7d92e90bb37cf6a5. Signed-off-by: Y.Hisaki --- clang-tidy-required-packages.yaml | 2 +- .../src/scene_intersection.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/clang-tidy-required-packages.yaml b/clang-tidy-required-packages.yaml index 0431051d73fa3..19e079c9facd3 100644 --- a/clang-tidy-required-packages.yaml +++ b/clang-tidy-required-packages.yaml @@ -130,7 +130,7 @@ # - autoware_behavior_velocity_blind_spot_module # - autoware_behavior_velocity_crosswalk_module # - autoware_behavior_velocity_detection_area_module -- autoware_behavior_velocity_intersection_module +# - autoware_behavior_velocity_intersection_module # - autoware_behavior_velocity_no_drivable_lane_module # - autoware_behavior_velocity_no_stopping_area_module # - autoware_behavior_velocity_occlusion_spot_module diff --git a/planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.cpp b/planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.cpp index f3a1b11ec2164..9f6935e6d7e7b 100644 --- a/planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.cpp +++ b/planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.cpp @@ -38,7 +38,6 @@ #include #include -// Hi! I'm a comment! namespace autoware::behavior_velocity_planner { namespace bg = boost::geometry;