Skip to content

Commit 3754a3d

Browse files
committed
fix(clang-tidy): re-enable bugprone-unused-local-non-trivial-variable
Re-enables bugprone-unused-local-non-trivial-variable in .clang-tidy-ci. The check was suppressed in #12431 with 2 reported errors. This PR addresses both: - autoware_manual_lane_change_handler: 'shift_unavailable_reason' was computed but never used in the subsequent log message. The fix appends it to the RCLCPP_INFO_STREAM so the log now reports the actual reason. - autoware_behavior_path_side_shift_module: 'centerline_path' (line 211 of scene.cpp) was computed via utils::calcCenterLinePath but never used anywhere in the package. Dating from 2023, it appears to be leftover from a refactor. Removed the dead call. Refs #12450 Signed-off-by: Vishal Chauhan <40782713+vish0012@users.noreply.github.com>
1 parent 54af299 commit 3754a3d

3 files changed

Lines changed: 2 additions & 6 deletions

File tree

.clang-tidy-ci

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Checks: "
1818
-bugprone-signed-char-misuse,
1919
-bugprone-switch-missing-default-case,
2020
-bugprone-unchecked-optional-access,
21-
-bugprone-unused-local-non-trivial-variable,
2221
-bugprone-unused-return-value"
2322

2423
WarningsAsErrors: "*"

planning/autoware_manual_lane_change_handler/src/manual_lane_change_handler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ LaneChangeRequestResult ManualLaneChangeHandler::process_lane_change_request(
315315
: "next segment is right turn";
316316
RCLCPP_INFO_STREAM(
317317
logger_, "Cannot shift on the current segment (ID: "
318-
<< current_segment.preferred_primitive.id << ")");
318+
<< current_segment.preferred_primitive.id
319+
<< "): " << shift_unavailable_reason);
319320
break;
320321
}
321322

planning/behavior_path_planner/autoware_behavior_path_side_shift_module/src/scene.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,6 @@ void SideShiftModule::updateData()
208208
if (getPreviousModuleOutput().reference_path.points.empty()) {
209209
return;
210210
}
211-
const auto centerline_path = utils::calcCenterLinePath(
212-
planner_data_, reference_pose, longest_dist_to_shift_line,
213-
getPreviousModuleOutput().reference_path);
214-
215211
constexpr double resample_interval = 1.0;
216212
const auto backward_extened_path = extendBackwardLength(getPreviousModuleOutput().path);
217213
reference_path_ = utils::resamplePathWithSpline(backward_extened_path, resample_interval);

0 commit comments

Comments
 (0)