Skip to content

Fix clang-tidy-flagged naming issues#362

Merged
knoepfel merged 10 commits intomainfrom
maintenance/clang-tidy-naming
Mar 4, 2026
Merged

Fix clang-tidy-flagged naming issues#362
knoepfel merged 10 commits intomainfrom
maintenance/clang-tidy-naming

Conversation

@greenc-FNAL
Copy link
Contributor

No description provided.

@greenc-FNAL
Copy link
Contributor Author

@phlexbot tidy-fix readability-identifier-naming

1 similar comment
@greenc-FNAL
Copy link
Contributor Author

@phlexbot tidy-fix readability-identifier-naming

@greenc-FNAL greenc-FNAL force-pushed the maintenance/clang-tidy-naming branch 2 times, most recently from e1aa8ad to fae5088 Compare February 25, 2026 18:43
@beojan
Copy link
Contributor

beojan commented Feb 25, 2026

Looks like it's changing the #define of header guards without changing the #ifndef to match.

@greenc-FNAL
Copy link
Contributor Author

Looks like it's changing the #define of header guards without changing the #ifndef to match.

The header guards are a known limitation for clang-tidy, which I address here with 6abc94e and in the workflow PR with a Python helper script.

However, using a pre-generated fixes YAML file when fixing only specific issues can lead to actual inconsistencies in the code, so I will be re-doing the fixes for this PR after resolving the issue in the workflow PR. Thanks for spotting this, @beojan!

@greenc-FNAL greenc-FNAL force-pushed the maintenance/clang-tidy-naming branch from 6abc94e to 7137a36 Compare February 27, 2026 16:26
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 96.62921% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
phlex/core/declared_fold.hpp 95.65% 1 Missing ⚠️
phlex/core/declared_unfold.hpp 83.33% 1 Missing ⚠️
phlex/core/multilayer_join_node.hpp 75.00% 0 Missing and 1 partial ⚠️
@@            Coverage Diff             @@
##             main     #362      +/-   ##
==========================================
+ Coverage   86.37%   86.43%   +0.05%     
==========================================
  Files         119      119              
  Lines        2400     2403       +3     
  Branches      387      387              
==========================================
+ Hits         2073     2077       +4     
  Misses        207      207              
+ Partials      120      119       -1     
Flag Coverage Δ
unittests 86.43% <96.62%> (+0.05%) ⬆️

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

Files with missing lines Coverage Δ
phlex/core/declared_observer.hpp 100.00% <100.00%> (ø)
phlex/core/declared_predicate.hpp 94.73% <100.00%> (ø)
phlex/core/declared_transform.hpp 88.57% <100.00%> (+0.33%) ⬆️
phlex/core/input_arguments.hpp 100.00% <100.00%> (ø)
phlex/core/registrar.hpp 81.25% <100.00%> (ø)
phlex/core/registration_api.hpp 100.00% <100.00%> (ø)
phlex/model/product_store.hpp 100.00% <100.00%> (ø)
phlex/model/type_id.hpp 92.77% <ø> (ø)
phlex/utilities/simple_ptr_map.hpp 100.00% <100.00%> (ø)
phlex/core/declared_fold.hpp 95.31% <95.65%> (+0.15%) ⬆️
... and 2 more

... and 1 file 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 2f9bec6...75b2636. Read the comment docs.

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

@greenc-FNAL greenc-FNAL marked this pull request as ready for review February 27, 2026 16:43
@greenc-FNAL greenc-FNAL requested a review from knoepfel February 27, 2026 16:43
Copy link
Member

@knoepfel knoepfel left a comment

Choose a reason for hiding this comment

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

@greenc-FNAL, all of these changes look consistent with what I would expect. It does illustrate at least one naming issue.

Whereas N and M seemed (to me) to be reasonable identifiers for representing the number of inputs and outputs, respectively, for an algorithm, the identifiers n and m are too easily glossed over.

I think the solution to this problem is to just replace n with num_inputs, and m with num_outputs (or something similar). That should maybe be another PR?

@greenc-FNAL
Copy link
Contributor Author

I think the solution to this problem is to just replace n with num_inputs, and m with num_outputs (or something similar). That should maybe be another PR?

Given that the originals (N, M) were OK, and the ones in this PR are not, I would lean towards changing their names in this PR as a post-fix commit, and mentioning it in the description and squashed commit message. Absolutely willing to go with what you prefer, though.

@knoepfel
Copy link
Member

I think the solution to this problem is to just replace n with num_inputs, and m with num_outputs (or something similar). That should maybe be another PR?

Given that the originals (N, M) were OK, and the ones in this PR are not, I would lean towards changing their names in this PR as a post-fix commit, and mentioning it in the description and squashed commit message. Absolutely willing to go with what you prefer, though.

Let's fix it here then

greenc-FNAL added a commit that referenced this pull request Feb 27, 2026
Per #362 (review):

- `n` -> `num_inputs`
- `m` -> `num_outputs`
@greenc-FNAL greenc-FNAL force-pushed the maintenance/clang-tidy-naming branch from 7ef4e8c to 544cac5 Compare February 27, 2026 20:56
@greenc-FNAL
Copy link
Contributor Author

@phlexbot clang-fix

@greenc-FNAL
Copy link
Contributor Author

@phlexbot format

greenc-FNAL added a commit that referenced this pull request Feb 27, 2026
Per #362 (review):

- `n` -> `num_inputs`
- `m` -> `num_outputs`
@greenc-FNAL greenc-FNAL force-pushed the maintenance/clang-tidy-naming branch from 0e54e8f to 626bc70 Compare February 27, 2026 21:41
@greenc-FNAL
Copy link
Contributor Author

@phlexbot format

@github-actions
Copy link
Contributor

No automatic header-guards fixes were necessary.

@github-actions
Copy link
Contributor

No automatic jsonnetfmt fixes were necessary.

@github-actions
Copy link
Contributor

No automatic cmake-format fixes were necessary.

@github-actions
Copy link
Contributor

No automatic clang-format fixes were necessary.

@github-actions
Copy link
Contributor

No automatic markdownlint fixes were necessary.

Copy link
Member

@knoepfel knoepfel left a comment

Choose a reason for hiding this comment

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

Only one request, @greenc-FNAL. Otherwise, looks great.

greenc-FNAL added a commit that referenced this pull request Mar 3, 2026
Per #362 (comment)

Co-authored-by: Kyle Knoepfel <knoepfel@fnal.gov>
Copilot AI review requested due to automatic review settings March 3, 2026 22:11
Copy link
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

Adjusts C++ identifier names to satisfy the repository’s clang-tidy naming rules (notably lower_case for most identifiers and CamelCase for template parameters), primarily within core graph node/registration code and a demo test.

Changes:

  • Renames various type aliases/constants/template parameters to match readability-identifier-naming settings.
  • Updates several core node implementations (transform/predicate/observer/unfold/fold) to use the renamed num_inputs/num_outputs constants.
  • Removes the ENABLE_CLANG_TIDY CMake option and its build-time integration logic.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/demo-giantdata/unfold_transform_fold.cpp Renames local tracker struct/type usage to match naming rules.
phlex/utilities/simple_ptr_map.hpp Renames internal type alias and updates related signatures.
phlex/model/type_id.hpp Renames internal signed-type alias to lower_case.
phlex/model/product_store.hpp Renames tuple-size constant to num_inputs.
phlex/core/registration_api.hpp Renames internal type aliases/constants (node_ptr, num_inputs, num_outputs).
phlex/core/registrar.hpp Renames internal Nodes alias to nodes and updates member type.
phlex/core/multilayer_join_node.hpp Renames template parameter to CamelCase and updates dependent uses.
phlex/core/input_arguments.hpp Renames tuple-size constant to num_inputs.
phlex/core/declared_unfold.hpp Renames internal aliases/constants and updates join/call wiring.
phlex/core/declared_transform.hpp Renames internal constants and updates join/call wiring.
phlex/core/declared_predicate.hpp Renames internal aliases/constants and updates join/call wiring.
phlex/core/declared_observer.hpp Renames internal aliases/constants and updates join/call wiring.
phlex/core/declared_fold.hpp Renames internal constants/type alias and updates join/call wiring (but introduces compile errors).
CMakeLists.txt Removes ENABLE_CLANG_TIDY option and CMake-based clang-tidy integration.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Automatic clang-format fixes pushed (commit 5deb57b).
⚠️ Note: Some issues may require manual review and fixing.

Copy link
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

@greenc-FNAL
Copy link
Contributor Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Mar 3, 2026

@greenc-FNAL I've opened a new pull request, #381, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
@greenc-FNAL
Copy link
Contributor Author

@phlexbot clang-fix

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

No automatic clang-format fixes were necessary.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

No automatic clang-tidy fixes were necessary.

Copy link
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

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

- Per #362 (comment)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

phlex/utilities/simple_ptr_map.hpp:37

  • The in-class comment still refers to Ptr (e.g., std::map<std::string, Ptr> / std::pair<..., Ptr>), but the alias was renamed to ptr. Updating the comment to match the current alias name would avoid confusion when reading this specialization.
    using ptr = std::unique_ptr<T>;
    std::map<std::string, ptr> data_;

  public:
    // std::map<std::string, Ptr> has a default constructor that does
    // not invoke the deleted default constructor of its
    // std::pair<std::string const, Ptr> data member, but the compiler

Copy link
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

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

Copy link
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

@knoepfel knoepfel merged commit b8c13f6 into main Mar 4, 2026
65 checks passed
@knoepfel knoepfel deleted the maintenance/clang-tidy-naming branch March 4, 2026 14:31
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.

5 participants