Skip to content

Fix straggling clang-tidy errors - #803

Open
knoepfel wants to merge 1 commit into
Framework-R-D:mainfrom
knoepfel:clang-tidy-stragglers
Open

Fix straggling clang-tidy errors#803
knoepfel wants to merge 1 commit into
Framework-R-D:mainfrom
knoepfel:clang-tidy-stragglers

Conversation

@knoepfel

@knoepfel knoepfel commented Aug 5, 2026

Copy link
Copy Markdown
Member

This PR addresses some clang-tidy issues that should already be resolved (according to the docs/dev/clang-tidy-fixes-2026-04.md checklist), but they either crept back in or were somehow skipped.

  • Code quality

    • Fixed clang-tidy findings in ROOT storage code by using inferred pointer types and explicit gsl::owner<void*> annotations.
    • Added a defaulted virtual destructor to ROOT_TTree_Write_ContainerImp.
    • Removed a redundant return statement from StorageReader::readContainer.
    • Defined framework_graph::driver_mode with std::uint8_t.
  • Tests

    • Replaced find(...) != std::string::npos checks with std::string::contains.
    • Used an explicitly typed std::size_t value in an execution-count assertion.
    • Simplified provide_ten_numbers with return-type deduction without changing behavior.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 98bd7352-fc59-492b-aa80-3bcb9d3347f6

📥 Commits

Reviewing files that changed from the base of the PR and between 240a461 and 32b7957.

📒 Files selected for processing (9)
  • form/root_storage/root_tbranch_read_container.cpp
  • form/root_storage/root_tbranch_write_container.cpp
  • form/root_storage/root_ttree_write_container.cpp
  • form/root_storage/root_ttree_write_container.hpp
  • form/storage/storage_reader.cpp
  • phlex/core/framework_graph.hpp
  • test/core_misc_test.cpp
  • test/fold_duplicate_layer_name_test.cpp
  • test/unfold.cpp
💤 Files with no reviewable changes (1)
  • form/storage/storage_reader.cpp
📜 Recent review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: build (gcc, none)
  • GitHub Check: Analyze cpp with CodeQL
  • GitHub Check: coverage
  • GitHub Check: clang-tidy-check
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{cpp,cc,cxx,h,hpp}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{cpp,cc,cxx,h,hpp}: Use clang-format tool for all C++ code formatting (VS Code auto-formats on save); configuration defined in .clang-format with 100-character line limit and 2-space indentation
Follow clang-tidy recommendations defined in .clang-tidy

Files:

  • test/fold_duplicate_layer_name_test.cpp
  • form/root_storage/root_tbranch_write_container.cpp
  • phlex/core/framework_graph.hpp
  • test/core_misc_test.cpp
  • form/root_storage/root_ttree_write_container.cpp
  • test/unfold.cpp
  • form/root_storage/root_ttree_write_container.hpp
  • form/root_storage/root_tbranch_read_container.cpp
**/*.{hpp,cpp}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{hpp,cpp}: Use .hpp for header files, .cpp for implementation, and *_test.cpp for test files in C++
Enforce 100-character line limit and 2-space indentation in C++ code via .clang-format
Use QualifierAlignment: Right (east-const) style: int const x not const int x in C++
Use PointerAlignment: Left in C++ (pointer * attached to type, not variable name)
All C++ identifiers must use lower_case naming: namespaces, classes, structs, enums, functions, variables, parameters, members, and constants
Exception to C++ naming: template parameters use CamelCase
Exception to C++ naming: macros use UPPER_CASE
Private, protected, and constant members in C++ must have a trailing underscore (_), no trailing underscore on anything else
Use enum class preferred over plain enum in C++
Use std::shared_ptr for shared ownership, std::unique_ptr for exclusive ownership, raw pointers for non-owning references only in C++
Use functors with agent-noun pattern: ModelEvaluator evaluate_model(...) in C++
Apply .clang-tidy checks for bugprone, cert, clang-analyzer, concurrency, cppcoreguidelines, misc, modernize, performance, portability, and readability as defined in the .clang-tidy configuration file
Use phlex:: namespace for core code, phlex::experimental:: for experimental features in C++

Files:

  • test/fold_duplicate_layer_name_test.cpp
  • form/root_storage/root_tbranch_write_container.cpp
  • phlex/core/framework_graph.hpp
  • test/core_misc_test.cpp
  • form/root_storage/root_ttree_write_container.cpp
  • test/unfold.cpp
  • form/root_storage/root_ttree_write_container.hpp
  • form/root_storage/root_tbranch_read_container.cpp
**/*.hpp

📄 CodeRabbit inference engine (AGENTS.md)

Avoid boolean parameters in C++ interfaces; prefer enumerations instead

Files:

  • phlex/core/framework_graph.hpp
  • form/root_storage/root_ttree_write_container.hpp
🪛 Cppcheck (2.21.0)
form/root_storage/root_ttree_write_container.cpp

[style] 39-39: The function 'getItems' is never used.

(unusedFunction)

🔇 Additional comments (9)
form/root_storage/root_tbranch_read_container.cpp (1)

34-34: LGTM!

Also applies to: 169-171

form/root_storage/root_tbranch_write_container.cpp (1)

35-35: LGTM!

Also applies to: 46-46

form/root_storage/root_ttree_write_container.cpp (1)

21-26: LGTM!

Also applies to: 38-40

form/root_storage/root_ttree_write_container.hpp (1)

19-19: LGTM!

test/fold_duplicate_layer_name_test.cpp (1)

90-90: LGTM!

test/unfold.cpp (1)

84-84: LGTM!

test/core_misc_test.cpp (1)

94-94: 🎯 Functional Correctness

C++ target matches these assertions.

The project sets C++23, so std::string::contains is available here.

phlex/core/framework_graph.hpp (2)

26-26: LGTM!


191-191: 🗄️ Data Integrity & Integration

Verify the ABI impact before merging this enum change.

framework_graph is exported and returned by value. Changing driver_mode to std::uint8_t can change sizeof(framework_graph), the offset of shutdown_on_error_, and the ABI of with_default_driver. Existing binaries built with the previous header may use the old object layout.

Verify the mixed-version ABI policy. If compatibility is required, keep the previous representation or process this as an ABI change. If compatibility is not required, document the rebuild requirement and add an ABI/layout check.


📝 Walkthrough

Walkthrough

This PR applies localized C++ modernization changes across ROOT storage, framework type declarations, storage control flow, and tests. It adds explicit ownership annotations, uses inferred pointer types, fixes an enum underlying type, and simplifies several expressions.

Changes

C++ modernization

Layer / File(s) Summary
ROOT storage ownership and pointer updates
form/root_storage/root_tbranch_read_container.cpp, form/root_storage/root_tbranch_write_container.cpp, form/root_storage/root_ttree_write_container.*
ROOT storage code uses auto* declarations and explicit gsl::owner annotations. ROOT_TTree_Write_ContainerImp now has a defaulted virtual destructor override.
Framework enum type declaration
phlex/core/framework_graph.hpp
driver_mode now uses std::uint8_t as its underlying type, with the required <cstdint> include.
Control-flow and test expression cleanup
form/storage/storage_reader.cpp, test/core_misc_test.cpp, test/fold_duplicate_layer_name_test.cpp, test/unfold.cpp
The storage reader removes a redundant return. Tests use contains, an explicit std::size_t expectation, and a deduced return type.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: greenc-fnal, aolivier23, gemmeren

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the pull request's main change: fixing remaining clang-tidy errors.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main     #803      +/-   ##
==========================================
- Coverage   83.89%   83.89%   -0.01%     
==========================================
  Files         171      172       +1     
  Lines        7234     7233       -1     
  Branches      850      850              
==========================================
- Hits         6069     6068       -1     
  Misses        881      881              
  Partials      284      284              
Flag Coverage Δ
scripts 80.09% <ø> (ø)
unittests 85.79% <100.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
form/root_storage/root_tbranch_read_container.cpp 87.02% <100.00%> (ø)
form/root_storage/root_tbranch_write_container.cpp 83.07% <100.00%> (-0.26%) ⬇️
form/root_storage/root_ttree_write_container.cpp 54.54% <100.00%> (ø)
form/root_storage/root_ttree_write_container.hpp 100.00% <100.00%> (ø)
form/storage/storage_reader.cpp 81.48% <ø> (-0.09%) ⬇️
phlex/core/framework_graph.hpp 100.00% <ø> (ø)

Continue to review full report in Codecov by Harness.

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

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

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.

1 participant