Skip to content

style: apply clang-format to new dd4hepplugins files (PR #266)#276

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/update-files-to-compliance
Closed

style: apply clang-format to new dd4hepplugins files (PR #266)#276
Copilot wants to merge 2 commits intomainfrom
copilot/update-files-to-compliance

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

New files added by the DD4hep integration PR (#266) did not comply with the repo's .clang-format policy. This PR applies the correct formatting to all new C/C++ sources under dd4hepplugins/.

Changes

  • SpacesInParentheses: true / SpaceBeforeParens: Never — all call sites and control-flow conditions reformatted:
    // before
    if (!pv) return -1;
    sev->beginOfEvent(eventID);
    
    // after
    if( !pv )
        return -1;
    sev->beginOfEvent( eventID );
  • AlignConsecutiveDeclarations / AlignConsecutiveAssignments — variable groups column-aligned:
    G4double Pmin  = Rindex->Energy( 0 );
    G4double Pmax  = Rindex->GetMaxEnergy();
    G4double nMax  = Rindex->GetMaxValue();
    G4double beta1 = step->GetPreStepPoint()->GetBeta();
  • Member initializersint x{0}int x{ 0 }
  • Namespace closing comments} // namespace} // namespace
  • Macro callsDDG4_DEFINE_ACTION_CONSTRUCTORS(X)DDG4_DEFINE_ACTION_CONSTRUCTORS( X )

No behavioral changes — formatting only.

Original prompt

Review pull request #266 in repository BNLNPPS/eic-opticks and create a PR that updates the newly added files so they comply with the repository's current style policy as enforced by .clang-format and the cpp-linter job in .github/workflows/build-pull-request.yaml.

Repository: BNLNPPS/eic-opticks
Upstream PR being reviewed: #266 ("Dd4hep integration")

Relevant style policy:

  • .clang-format is based on Microsoft style with:
    • ColumnLimit: 0
    • DerivePointerAlignment: true
    • ReferenceAlignment: Pointer
    • SpaceBeforeParens: Never
    • SpacesInParentheses: true
    • SortIncludes: false
    • ReflowComments: false
    • AlignTrailingComments: false
    • AlignConsecutiveDeclarations: Consecutive
    • AlignConsecutiveAssignments: Consecutive
  • cpp-linter workflow settings from .github/workflows/build-pull-request.yaml:
    • style: file
    • ignore: include/argparse
    • lines-changed-only: true
    • thread-comments: true
    • format-review: true
    • tidy-checks: '-*'

Scope:

  • Focus on the new files introduced by PR feat(dd4hep): add experimental DDG4 integration plugins and examples #266, especially the new C/C++ sources and headers under dd4hepplugins/ and any other newly added C/C++ files in the PR.
  • Ensure formatting matches .clang-format exactly.
  • Adjust only style/formatting and linter-compliance issues; do not change intended behavior.
  • If there are workflow-relevant stylistic issues in newly added CMake files that should be cleaned up for consistency, include those too, but prioritize files checked by cpp-linter.

Files added in the PR include new C++ headers/sources such as:

  • dd4hepplugins/CMakeLists.txt
  • dd4hepplugins/DD4hepSensorIdentifier.hh
  • dd4hepplugins/OpticsEvent.cc
  • dd4hepplugins/OpticsEvent.hh
  • dd4hepplugins/OpticsRun.cc
  • dd4hepplugins/OpticsRun.hh
  • dd4hepplugins/OpticsSteppingAction.cc
  • dd4hepplugins/OpticsSteppingAction.hh
  • dd4hepplugins/examples/CMakeLists.txt
  • dd4hepplugins/examples/geometry/Raindrop_geo.cpp

Please create a pull request with the style-only fixes.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Since all of these files are new, can we make sure they comply with the current style policy defined in .clang-format and the cpp-linter workflow job?

Assistant: We’re waiting for your response to the pull request creation prompt before I can continue.

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Update new files to comply with style policy style: apply clang-format to new dd4hepplugins files (PR #266) Apr 7, 2026
Copilot AI requested a review from plexoos April 7, 2026 17:26
@plexoos plexoos closed this Apr 7, 2026
@plexoos plexoos deleted the copilot/update-files-to-compliance branch April 7, 2026 20:52
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.

2 participants