Skip to content

fix(clang-tidy): re-enable bugprone-unused-local-non-trivial-variable#12563

Open
vish0012 wants to merge 4 commits intoautowarefoundation:mainfrom
vish0012:fix/clang-tidy-unused-local-non-trivial-variable
Open

fix(clang-tidy): re-enable bugprone-unused-local-non-trivial-variable#12563
vish0012 wants to merge 4 commits intoautowarefoundation:mainfrom
vish0012:fix/clang-tidy-unused-local-non-trivial-variable

Conversation

@vish0012
Copy link
Copy Markdown
Contributor

Re-enables bugprone-unused-local-non-trivial-variable in .clang-tidy-ci.

The check was suppressed in #12431 with 2 reported errors. This PR fixes both.

Refs #12450

Fixes

autoware_manual_lane_change_handler

shift_unavailable_reason was computed but never used. Added it to the existing RCLCPP_INFO_STREAM log so the message now reports why the shift was unavailable.

autoware_behavior_path_side_shift_module

centerline_path in scene.cpp was computed but never used anywhere in the package. Removed the dead call.

How to reproduce

colcon build --packages-up-to \
  autoware_manual_lane_change_handler \
  autoware_behavior_path_side_shift_module \
  --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=1

run-clang-tidy -p build/ \
  -export-fixes /tmp/clang-tidy-result/fixes.yaml \
  -j $(nproc) \
  autoware_manual_lane_change_handler \
  autoware_behavior_path_side_shift_module \
  > /tmp/clang-tidy-result/report.log

grep "bugprone-unused-local-non-trivial-variable" /tmp/clang-tidy-result/report.log | grep "error:"

Result

Before: 2 errors
After: 0 errors

Re-enables bugprone-unused-local-non-trivial-variable in .clang-tidy-ci.

The check was suppressed in autowarefoundation#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 autowarefoundation#12450

Signed-off-by: Vishal Chauhan <40782713+vish0012@users.noreply.github.com>
@vish0012 vish0012 requested a review from mitsudome-r May 11, 2026 00:49
@github-actions github-actions Bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label May 11, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

Thank you for contributing to the Autoware project!

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

Please ensure:

@vish0012 vish0012 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label May 11, 2026
pre-commit-ci-lite Bot and others added 3 commits May 11, 2026 00:54
Signed-off-by: Vishal Chauhan <40782713+vish0012@users.noreply.github.com>
Signed-off-by: Vishal Chauhan <40782713+vish0012@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:planning Route planning, decision-making, and navigation. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

1 participant