Skip to content

clang-tidy: resolve bugprone-return-const-ref-from-parameter#499

Merged
knoepfel merged 3 commits intomainfrom
maintenance/clang-tidy/bugprone-return-const-ref-from-parameter
Apr 10, 2026
Merged

clang-tidy: resolve bugprone-return-const-ref-from-parameter#499
knoepfel merged 3 commits intomainfrom
maintenance/clang-tidy/bugprone-return-const-ref-from-parameter

Conversation

@greenc-FNAL
Copy link
Copy Markdown
Contributor

All existing ocurrences were intentional, and have been marked as such with NOLINT.

Copilot AI review requested due to automatic review settings April 9, 2026 19:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses clang-tidy’s bugprone-return-const-ref-from-parameter findings by explicitly marking intentional “return-by-const-ref” patterns with NOLINT in a few small helper functions used across the model/core layers.

Changes:

  • Add // NOLINT(bugprone-return-const-ref-from-parameter) to intentional return-by-const-ref sites in more_derived(...) helpers.
  • Add the same suppression to an internal maybe_name(...) helper that returns either a static sentinel or the input string.
  • Reformat a couple of one-line inline overloads into multi-line bodies while adding the suppression.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
phlex/model/product_store.hpp Adds suppression for the single-arg most_derived overload (but currently placed in a way that likely won’t suppress the warning).
phlex/model/product_store.cpp Adds NOLINT to the two return statements in more_derived(...).
phlex/model/data_layer_hierarchy.cpp Adds NOLINT to the ternary return in maybe_name(...).
phlex/core/message.hpp Rewrites the single-arg most_derived overload into multi-line form and adds NOLINT to the return.
phlex/core/message.cpp Adds NOLINT to the two return statements in more_derived(...).

All existing ocurrences were intentional, and have been marked as such with `NOLINT`.
@greenc-FNAL greenc-FNAL force-pushed the maintenance/clang-tidy/bugprone-return-const-ref-from-parameter branch from d8afae3 to b40ea15 Compare April 9, 2026 19:22
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
phlex/core/message.cpp 50.00% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main     #499      +/-   ##
==========================================
+ Coverage   85.57%   85.62%   +0.05%     
==========================================
  Files         142      142              
  Lines        3604     3604              
  Branches      616      616              
==========================================
+ Hits         3084     3086       +2     
+ Misses        310      309       -1     
+ Partials      210      209       -1     
Flag Coverage Δ
unittests 85.62% <85.71%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
phlex/core/message.hpp 100.00% <100.00%> (ø)
phlex/model/data_layer_hierarchy.cpp 100.00% <100.00%> (ø)
phlex/model/product_store.cpp 83.33% <100.00%> (ø)
phlex/model/product_store.hpp 100.00% <100.00%> (ø)
phlex/core/message.cpp 41.66% <50.00%> (-8.34%) ⬇️

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51fc599...8351e26. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@knoepfel knoepfel merged commit d48f675 into main Apr 10, 2026
36 checks passed
@knoepfel knoepfel deleted the maintenance/clang-tidy/bugprone-return-const-ref-from-parameter branch April 10, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants