Skip to content

[PWGLF] Fix Clang-Tidy errors - #19026

Open
vkucera wants to merge 1 commit into
AliceO2Group:masterfrom
vkucera:clang-tidy-errors-PWGLF
Open

vkucera wants to merge 1 commit into
AliceO2Group:masterfrom
vkucera:clang-tidy-errors-PWGLF

Conversation

@vkucera

@vkucera vkucera commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes errors from the clang-* Clang-Tidy categories.

  • Fixes a bug where the address of a temporary object on stack was returned.
  • Replaces redundant default constructors with default member initialisation.

Fixes errors from the `clang-*` Clang-Tidy categories.
@github-actions github-actions Bot added the pwglf label Dec 1, 2026
@github-actions github-actions Bot changed the title Fix Clang-Tidy errors [PWGLF] Fix Clang-Tidy errors Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

O2 linter results: ❌ 0 errors, ⚠️ 0 warnings, 🔕 3 disabled

@vkucera
vkucera marked this pull request as ready for review December 1, 2026 15:14
@alibuild

alibuild commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 6530581 at 2026-12-01 16:25:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'To reproduce the results below locally, run: '\''aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'\''.'
To reproduce the results below locally, run: 'aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'.
++ echo 'To apply all automatic fixes, add the '\''-e O2PHYSICS_CHECKER_FIX=1'\'' option.'
To apply all automatic fixes, add the '-e O2PHYSICS_CHECKER_FIX=1' option.
++ echo 'See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.'
See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.
++ echo 'Found 10 errors and 197 warnings.'
Found 10 errors and 197 warnings.
++ [[ 10 -gt 0 ]]
++ cat /sw/BUILD/5f75e0a59452222946f33e08071dfb3a619980f6/O2Physics-code-check/errors.txt
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:226:10: error: std::move of the const variable 'name_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:226:28: error: std::move of the const variable 'daughters_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:226:51: error: std::move of the const variable 'daughterTrackSigns_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:226:83: error: std::move of the const variable 'v0DaughterVec_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:234:10: error: std::move of the const variable 'name_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:234:28: error: std::move of the const variable 'daughters_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:234:51: error: std::move of the const variable 'daughterTrackSigns_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:746:9: error: 'push_back' is called inside a loop; consider pre-allocating the container capacity before the loop [performance-inefficient-vector-operation,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx:464:7: error: 'push_back' is called inside a loop; consider pre-allocating the container capacity before the loop [performance-inefficient-vector-operation,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx:512:7: error: 'push_back' is called inside a loop; consider pre-allocating the container capacity before the loop [performance-inefficient-vector-operation,-warnings-as-errors]
++ [[ 197 -gt 0 ]]
++ cat /sw/BUILD/5f75e0a59452222946f33e08071dfb3a619980f6/O2Physics-code-check/warnings.txt
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:81:34: warning: variable 'metadataInfo' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:86:18: warning: 'nDaughterParticles' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:97:39: warning: 'particleNames' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:98:31: warning: 'particlePdgCodes' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:99:34: warning: 'particleMasses' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:100:31: warning: 'particleCharge' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:111:39: warning: 'betheBlochParNames' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:112:11: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:139:39: warning: 'trackPIDsettingNames' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:140:11: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:148:18: warning: 'nHyperNuclei' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:149:39: warning: 'hyperNucNames' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:150:18: warning: 'nHypNucDefs' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:159:39: warning: 'hypNucDefsLb' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:181:39: warning: 'preSelectionPrimNames' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:182:11: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:201:8: warning: use default member initializer for 'active' [modernize-use-default-member-init]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:202:3: warning: constructor does not initialize these fields: betheParams, trkSettings [cppcoreguidelines-pro-type-member-init]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:239:36: warning: statement should be inside braces [readability-braces-around-statements]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:241:46: warning: statement should be inside braces [readability-braces-around-statements]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:243:42: warning: statement should be inside braces [readability-braces-around-statements]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:252:98: warning: statement should be inside braces [readability-braces-around-statements]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:264:26: warning: use default member initializer for 'hypNucId' [modernize-use-default-member-init]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:269:3: warning: constructor does not initialize these fields: dcaToPv, dcaToPvXY, dcaToPvZ, active [cppcoreguidelines-pro-type-member-init]
[0 more errors; see full log]

Full log here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants