Skip to content

Fix clang-tidy-flagged naming issues#362

Open
greenc-FNAL wants to merge 4 commits intomainfrom
maintenance/clang-tidy-naming
Open

Fix clang-tidy-flagged naming issues#362
greenc-FNAL wants to merge 4 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.51163% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
phlex/core/declared_fold.hpp 95.45% 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   85.36%   85.37%   +0.01%     
==========================================
  Files         122      122              
  Lines        2433     2435       +2     
  Branches      389      389              
==========================================
+ Hits         2077     2079       +2     
+ Misses        233      232       -1     
- Partials      123      124       +1     
Flag Coverage Δ
unittests 85.37% <96.51%> (+0.01%) ⬆️

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% <ø> (ø)
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% <ø> (ø)
phlex/core/declared_fold.hpp 95.23% <95.45%> (+0.07%) ⬆️
... and 2 more

... and 4 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 8759264...626bc70. 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 and others added 4 commits February 27, 2026 15:41
Local commands:

```console
$ cmake -S /phlex-src -DCMAKE_BUILD_TYPE=Debug -B /phlex-src/phlex-build -GNinja --preset default -DCMAKE_EXPORT_COMPILE_COMMANDS=YES -DPHLEX_USE_FORM=YES -DFORM_USE_ROOT_STORAGE=YES -DCMAKE_CXX_CLANG_TIDY='clang-tidy;--export-fixes;clang-tidy-fixes.yaml;--checks=-*,readability-identifier-naming'
$ cmake --build /phlex-src/phlex-build
$ clang-apply-replacements /phlex-src/phlex-build
```
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.

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