Skip to content
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

fix(simple_planning_simulator): fix bugprone-branch-clone #9725

Merged
merged 4 commits into from
Jan 6, 2025

Conversation

kobayu858
Copy link
Contributor

Description

This is a fix based on clang-tidy bugprone-branch-clone error.
The second error was suppressed due to the complexity of the condition.
Conditions can be summarized if necessary.

/home/emb4/autoware/autoware/src/universe/autoware.universe/simulator/simple_planning_simulator/src/simple_planning_simulator/simple_planning_simulator_core.cpp:588:49: error: repeated branch in conditional chain [bugprone-branch-clone,-warnings-as-errors]
      if constexpr (std::is_same_v<T, Control>) {
                                                ^
/home/emb4/autoware/autoware/src/universe/autoware.universe/simulator/simple_planning_simulator/src/simple_planning_simulator/simple_planning_simulator_core.cpp:590:8: note: end of the original
      } else if constexpr (std::is_same_v<T, ActuationCommandStamped>) {
       ^
/home/emb4/autoware/autoware/src/universe/autoware.universe/simulator/simple_planning_simulator/src/simple_planning_simulator/simple_planning_simulator_core.cpp:590:72: note: clone 1 starts here
      } else if constexpr (std::is_same_v<T, ActuationCommandStamped>) {
                                                                       ^
/home/emb4/autoware/autoware/src/universe/autoware.universe/simulator/simple_planning_simulator/src/simple_planning_simulator/simple_planning_simulator_core.cpp:643:63: error: repeated branch in conditional chain [bugprone-branch-clone,-warnings-as-errors]
    vehicle_model_type_ == VehicleModelType::DELAY_STEER_ACC) {
                                                              ^

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
@kobayu858 kobayu858 requested a review from veqcc December 23, 2024 07:39
@github-actions github-actions bot added the component:simulation Virtual environment setups and simulations. (auto-assigned) label Dec 23, 2024
Copy link

github-actions bot commented Dec 23, 2024

Thank you for contributing to the Autoware project!

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

Please ensure:

@kobayu858 kobayu858 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 23, 2024
Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.74%. Comparing base (a32cae1) to head (ee1a443).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9725      +/-   ##
==========================================
- Coverage   28.77%   28.74%   -0.03%     
==========================================
  Files        1457     1458       +1     
  Lines      109221   109246      +25     
  Branches    42566    42566              
==========================================
- Hits        31428    31403      -25     
- Misses      74714    74766      +52     
+ Partials     3079     3077       -2     
Flag Coverage Δ *Carryforward flag
differential 27.27% <ø> (?)
total 28.74% <ø> (-0.03%) ⬇️ Carriedforward from 33b9913

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kobayu858
Copy link
Contributor Author

@soblin @maxime-clem @TakaHoribe @xtk8532704 @tkimura4 @zulfaqar-azmi-t4
Please confirm the PR. Thank you very much.

@kobayu858 kobayu858 merged commit a8a843a into autowarefoundation:main Jan 6, 2025
33 of 34 checks passed
kyoichi-sugahara pushed a commit to kyoichi-sugahara/autoware.universe that referenced this pull request Jan 6, 2025
…undation#9725)

* fix: bugprone-error

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>

* fix: build error

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>

---------

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:simulation Virtual environment setups and simulations. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants