-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tmp: test clang-tidy #2218
tmp: test clang-tidy #2218
Conversation
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
clang-tidy results on my local machine. ❯ clang-tidy -p build/ -export-fixes /tmp/clang-tidy-result/fixes.yaml src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp
33073 warnings generated.
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:32:14: warning: invalid case style for function 'getGateModeName' [readability-identifier-naming]
const char * getGateModeName(const GateMode::_data_type & gate_mode)
^~~~~~~~~~~~~~~
get_gate_mode_name
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:144:5: warning: uninitialized record type: 'p' [cppcoreguidelines-pro-type-member-init]
VehicleCmdFilterParam p;
^
{}
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:156:5: warning: uninitialized record type: 'p' [cppcoreguidelines-pro-type-member-init]
VehicleCmdFilterParam p;
^
{}
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:424:59: warning: narrowing conversion from 'double' to 'autoware_auto_control_msgs::msg::LongitudinalCommand_::_acceleration_type' (aka 'float') [cppcoreguidelines-narrowing-conversions]
filtered_commands.control.longitudinal.acceleration = stop_hold_acceleration_;
^
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:537:37: warning: narrowing conversion from 'double' to 'autoware_auto_control_msgs::msg::AckermannLateralCommand_::_steering_tire_angle_type' (aka 'float') [cppcoreguidelines-narrowing-conversions]
cmd.lateral.steering_tire_angle = current_steer_;
^
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:540:35: warning: narrowing conversion from 'double' to 'autoware_auto_control_msgs::msg::LongitudinalCommand_::_acceleration_type' (aka 'float') [cppcoreguidelines-narrowing-conversions]
cmd.longitudinal.acceleration = stop_hold_acceleration_;
^
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:555:35: warning: narrowing conversion from 'double' to 'autoware_auto_control_msgs::msg::LongitudinalCommand_::_acceleration_type' (aka 'float') [cppcoreguidelines-narrowing-conversions]
cmd.longitudinal.acceleration = emergency_acceleration_;
^
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:618:43: warning: the const qualified parameter 'request_header' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
const std::shared_ptr<rmw_request_id_t> request_header,
^
&
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:619:78: warning: the const qualified parameter 'request' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
const std::shared_ptr<tier4_external_api_msgs::srv::SetEmergency::Request> request,
^
&
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:620:79: warning: the const qualified parameter 'response' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
const std::shared_ptr<tier4_external_api_msgs::srv::SetEmergency::Response> response)
^
&
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:638:60: warning: the const qualified parameter 'req_header' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
[[maybe_unused]] const std::shared_ptr<rmw_request_id_t> req_header,
^
&
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:639:75: warning: the const qualified parameter 'req' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
[[maybe_unused]] const std::shared_ptr<std_srvs::srv::Trigger::Request> req,
^
&
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:640:59: warning: the const qualified parameter 'res' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
const std::shared_ptr<std_srvs::srv::Trigger::Response> res)
^
&
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:650:60: warning: the const qualified parameter 'req_header' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
[[maybe_unused]] const std::shared_ptr<rmw_request_id_t> req_header,
^
&
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:651:75: warning: the const qualified parameter 'req' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
[[maybe_unused]] const std::shared_ptr<std_srvs::srv::Trigger::Request> req,
^
&
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:652:59: warning: the const qualified parameter 'res' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
const std::shared_ptr<std_srvs::srv::Trigger::Response> res)
^
&
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:672:22: error: method 'checkExternalEmergencyStop' can be made const [readability-make-member-function-const,-warnings-as-errors]
void VehicleCmdGate::checkExternalEmergencyStop(diagnostic_updater::DiagnosticStatusWrapper & stat)
^
const
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.hpp:196:8: warning: function 'vehicle_cmd_gate::VehicleCmdGate::publishControlCommands' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]
void publishControlCommands(const Commands & input_msg);
^
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:381:22: note: the definition seen here
void VehicleCmdGate::publishControlCommands(const Commands & commands)
^
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.hpp:196:8: note: differing parameters are named here: ('input_msg'), in definition: ('commands')
void publishControlCommands(const Commands & input_msg);
^ ~~~~~~~~~
commands
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.hpp:214:27: warning: function 'vehicle_cmd_gate::VehicleCmdGate::filterControlCommand' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]
AckermannControlCommand filterControlCommand(const AckermannControlCommand & msg);
^
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp:506:41: note: the definition seen here
AckermannControlCommand VehicleCmdGate::filterControlCommand(const AckermannControlCommand & in)
^
/home/kenji/autoware/src/universe/autoware.universe/control/vehicle_cmd_gate/src/vehicle_cmd_gate.hpp:214:27: note: differing parameters are named here: ('msg'), in definition: ('in')
AckermannControlCommand filterControlCommand(const AckermannControlCommand & msg);
^ ~~~
in
Error opening output file: No such file or directory |
Codecov ReportBase: 11.08% // Head: 11.07% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2218 +/- ##
==========================================
- Coverage 11.08% 11.07% -0.02%
==========================================
Files 1202 1202
Lines 86198 86359 +161
Branches 20706 20815 +109
==========================================
+ Hits 9559 9560 +1
- Misses 66546 66693 +147
- Partials 10093 10106 +13
*This pull request uses carry forward flags. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy
found issue(s) with the introduced code (1/1)
@@ -149,7 +151,7 @@ | |||
p.actual_steer_diff_lim = declare_parameter("nominal.actual_steer_diff_lim", 1.0); | |||
filter_.setParam(p); | |||
} | |||
|
|||
// tmp | |||
{ | |||
VehicleCmdFilterParam p; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uninitialized record type: p
VehicleCmdFilterParam p; | |
VehicleCmdFilterParam p{}; |
@@ -601,6 +613,7 @@ | |||
return dt; | |||
} | |||
|
|||
// tmp | |||
void VehicleCmdGate::onExternalEmergencyStopService( | |||
const std::shared_ptr<rmw_request_id_t> request_header, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the const qualified parameter request_header
is copied for each invocation; consider making it a reference
const std::shared_ptr<rmw_request_id_t> request_header, | |
const std::shared_ptr<rmw_request_id_t>& request_header, |
@@ -601,6 +613,7 @@ | |||
return dt; | |||
} | |||
|
|||
// tmp | |||
void VehicleCmdGate::onExternalEmergencyStopService( | |||
const std::shared_ptr<rmw_request_id_t> request_header, | |||
const std::shared_ptr<tier4_external_api_msgs::srv::SetEmergency::Request> request, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the const qualified parameter request
is copied for each invocation; consider making it a reference
const std::shared_ptr<tier4_external_api_msgs::srv::SetEmergency::Request> request, | |
const std::shared_ptr<tier4_external_api_msgs::srv::SetEmergency::Request>& request, |
@@ -655,6 +668,7 @@ | |||
return true; | |||
} | |||
|
|||
// tmp | |||
void VehicleCmdGate::checkExternalEmergencyStop(diagnostic_updater::DiagnosticStatusWrapper & stat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method checkExternalEmergencyStop
can be made const
void VehicleCmdGate::checkExternalEmergencyStop(diagnostic_updater::DiagnosticStatusWrapper & stat) | |
void VehicleCmdGate::checkExternalEmergencyStop(diagnostic_updater::DiagnosticStatusWrapper & stat) const |
How to use the
|
FYI @xmfcx |
Just testing, don't merge.