autowarefoundation / autoware.universe

https://autowarefoundation.github.io/autoware.universe/
Apache License 2.0
1.01k stars 650 forks source link

fix(cppcheck_CI): fix unknownMacro #8894

Closed kobayu858 closed 1 month ago

kobayu858 commented 2 months ago

Description

This is a fix based on cppcheck unknownMacro warnings. The problem is that files with this error are not parsed well. This PR solves that problem at the same time.

common/bag_time_manager_rviz_plugin/src/bag_time_manager_panel.hpp:44:11: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
protected Q_SLOTS:
          ^
common/polar_grid/src/polar_grid_display.hpp:81:9: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
private Q_SLOTS:
        ^
common/tier4_adapi_rviz_plugin/src/door_panel.hpp:58:9: error: There is an unknown macro here somewhere. Configuration is required. If slots is a macro then please configure it. [unknownMacro]
private slots:
        ^
common/tier4_adapi_rviz_plugin/src/route_panel.hpp:72:9: error: There is an unknown macro here somewhere. Configuration is required. If slots is a macro then please configure it. [unknownMacro]
private slots:
        ^
common/tier4_adapi_rviz_plugin/src/state_panel.hpp:67:8: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
public Q_SLOTS:  // NOLINT for Qt
       ^
common/tier4_camera_view_rviz_plugin/src/bird_eye_view_tool.hpp:88:9: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
private Q_SLOTS:
        ^
common/tier4_camera_view_rviz_plugin/src/third_person_view_tool.hpp:88:9: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
private Q_SLOTS:
        ^
common/tier4_localization_rviz_plugin/src/pose_history_footprint/display.hpp:63:9: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
private Q_SLOTS:
        ^
common/tier4_localization_rviz_plugin/src/pose_with_covariance_history/pose_with_covariance_history_display.hpp:65:9: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
private Q_SLOTS:
        ^
common/tier4_planning_rviz_plugin/src/path/display.cpp:138:1: error: There is an unknown macro here somewhere. Configuration is required. If PLUGINLIB_EXPORT_CLASS is a macro then please configure it. [unknownMacro]
PLUGINLIB_EXPORT_CLASS(rviz_plugins::AutowarePathWithLaneIdDisplay, rviz_common::Display)
^
common/tier4_planning_rviz_plugin/src/tools/max_velocity.hpp:61:9: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
private Q_SLOTS:
        ^
common/tier4_state_rviz_plugin/src/include/autoware_state_panel.hpp:88:8: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
public Q_SLOTS:  // NOLINT for Qt
       ^
common/tier4_system_rviz_plugin/src/mrm_summary_overlay_display.hpp:82:9: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
private Q_SLOTS:
        ^
common/tier4_traffic_light_rviz_plugin/src/traffic_light_publish_panel.hpp:50:8: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
public Q_SLOTS:
       ^
common/tier4_vehicle_rviz_plugin/src/tools/acceleration_meter.hpp:48:9: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
private Q_SLOTS:
        ^
common/tier4_vehicle_rviz_plugin/src/tools/console_meter.hpp:49:9: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
private Q_SLOTS:
        ^
common/tier4_vehicle_rviz_plugin/src/tools/steering_angle.hpp:47:9: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
private Q_SLOTS:
        ^
common/tier4_vehicle_rviz_plugin/src/tools/turn_signal.hpp:46:9: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
private Q_SLOTS:
        ^
common/tier4_vehicle_rviz_plugin/src/tools/velocity_history.hpp:50:9: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
private Q_SLOTS:
        ^
planning/behavior_path_planner/autoware_behavior_path_external_request_lane_change_module/src/manager.cpp:45:1: error: There is an unknown macro here somewhere. Configuration is required. If PLUGINLIB_EXPORT_CLASS is a macro then please configure it. [unknownMacro]
PLUGINLIB_EXPORT_CLASS(
^
planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/manager.cpp:429:1: error: There is an unknown macro here somewhere. Configuration is required. If PLUGINLIB_EXPORT_CLASS is a macro then please configure it. [unknownMacro]
PLUGINLIB_EXPORT_CLASS(
^
planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/manager.cpp:594:1: error: There is an unknown macro here somewhere. Configuration is required. If PLUGINLIB_EXPORT_CLASS is a macro then please configure it. [unknownMacro]
PLUGINLIB_EXPORT_CLASS(
^
simulator/tier4_dummy_object_rviz_plugin/src/tools/interactive_object.hpp:142:11: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
protected Q_SLOTS:
          ^
simulator/tier4_dummy_object_rviz_plugin/src/tools/delete_all_objects.hpp:75:9: error: There is an unknown macro here somewhere. Configuration is required. If Q_SLOTS is a macro then please configure it. [unknownMacro]
private Q_SLOTS:
        ^

Related links

Parent Issue:

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

github-actions[bot] commented 2 months ago

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

kobayu858 commented 1 month ago

@veqcc

By using the -D option, we were able to make the macro understood without creating a new file. I have checked locally, but have not checked the CI because I was not sure how to check it.

kobayu858 commented 1 month ago

@veqcc

The file signal_display.cpp in which PLUGINLIB_EXPORT_CLASS exists has been modified and tested for CI.

If the command is wrong, I get the following error.

common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin/src/signal_display.cpp:499:1: error: syntax error [syntaxError] PLUGINLIB_EXPORT_CLASS(autoware_overlay_rviz_plugin::SignalDisplay, rviz_common::Display) ^

However, since it did not appear this time, I was able to confirm that it is working without any problem.