Skip to content

style: clang-format DD4hep integration files for dd4hep_integration merge#277

Merged
plexoos merged 2 commits intodd4hep_integrationfrom
copilot/clang-format-fixes-for-dd4hep-integration
Apr 7, 2026
Merged

style: clang-format DD4hep integration files for dd4hep_integration merge#277
plexoos merged 2 commits intodd4hep_integrationfrom
copilot/clang-format-fixes-for-dd4hep-integration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

New files introduced by the DD4hep integration (PR #266) were not compliant with the repo's .clang-format policy, blocking a clean merge into dd4hep_integration under the cpp-linter CI check.

Changes

  • Ran clang-format --style=file -i against all 8 new files in dd4hepplugins/:
    • DD4hepSensorIdentifier.hh
    • OpticsEvent.{cc,hh}
    • OpticsRun.{cc,hh}
    • OpticsSteppingAction.{cc,hh}
    • examples/geometry/Raindrop_geo.cpp

Formatting only — no behavioral or logic changes. Applies the Microsoft-based style with ColumnLimit: 0, SpaceBeforeParens: Never, SpacesInParentheses: true, AlignConsecutiveDeclarations/Assignments: Consecutive, and related settings from root .clang-format.

Original prompt

Create a pull request in repository BNLNPPS/eic-opticks that contains only clang-format / style-policy formatting fixes needed so the new files from PR #266 ("Dd4hep integration") can be merged cleanly into the dd4hep_integration branch.

Repository: BNLNPPS/eic-opticks
Base branch for the new PR: dd4hep_integration
Context: The previous PR was incorrect. The user explicitly wants a PR with clang style formatting changes intended to merge into dd4hep_integration.

Requirements:

  • Produce a formatting-only PR.
  • Target branch must be dd4hep_integration.
  • Apply the repository's .clang-format policy exactly.
  • Ensure compatibility with the cpp-linter workflow job configuration in .github/workflows/build-pull-request.yaml.
  • Do not make behavioral or logic changes.
  • Limit edits to formatting/style/linter-compliance for the relevant newly added files from the DD4hep integration work.

Relevant style config from .clang-format:

  • BasedOnStyle: Microsoft
  • ColumnLimit: 0
  • DerivePointerAlignment: true
  • ReferenceAlignment: Pointer
  • SpaceBeforeParens: Never
  • SpacesInParentheses: true
  • SortIncludes: false
  • ReflowComments: false
  • AlignTrailingComments: false
  • AlignConsecutiveDeclarations: Consecutive
  • AlignConsecutiveAssignments: Consecutive

Relevant cpp-linter workflow config:

  • style: file
  • ignore: include/argparse
  • lines-changed-only: true
  • format-review: true
  • tidy-checks: '-*'

Focus especially on new C/C++ files under dd4hepplugins/ and related DD4hep integration sources introduced by PR #266, including:

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

If needed, include consistent style cleanup in adjacent newly added CMake files for this integration, but keep the PR formatting-only.

Please create the PR against dd4hep_integration.

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.

User: @copilot Accepted Confirmation: Confirm agent session

Assistant: Started — I’ve kicked off a coding task to apply the repo’s current formatting policy to the new files and open a PR with style-only fixes.

You can track progress here:

data:
    - title: '[WIP] Update new files to comply with style policy'
      repository: BNLNPPS/eic-opticks
      url: https://github.com/copilot/tasks/pull/PR_kwDOMcnxFs7QkZnq?session_id=a9ee1bc2-5357-4ba2-8707-2fc40935a433
      state: queued

Based on the files you shared, the main checks are:

  • .clang-format style from the repo
  • cpp-linter using style: file
  • only changed lines are enforced by the workflow, but since these are new files, effectively most or all lines matter

If you want, once that task finishes I can also help review the resulting formatting diff for anything non-style that slipped in.

User: The PR you created is wrong. You need to create a PR with clang style formatting changes in order to merge these changes into dd4hep_integration

Assistant: Understood — the fix PR needs to target dd4hep_integration and contain only clang-format/style changes for those DD4hep integration files.

I’ve corrected the request and set it up with:

  • base branch: dd4hep_integration
  • scope: formatting-only changes
  • goal: make the DD4hep integration files compliant with the repo’s formatting policy and linter expectations

I can’t check the new task status from here right now, but if you paste the resulting PR link or diff once it appears, I can quickly verify that it’s targeting dd4hep_integration and that it only contains style changes.

This pull request was created from Copilot chat.

Apply the repository's .clang-format policy (Microsoft-based style) to all
newly introduced DD4hep integration files in dd4hepplugins/. No behavioral
or logic changes — formatting only.

Agent-Logs-Url: https://github.com/BNLNPPS/eic-opticks/sessions/cdb5b6e6-8f61-4a94-90ea-dba37be52b25

Co-authored-by: plexoos <5005079+plexoos@users.noreply.github.com>
Copilot AI changed the title [WIP] Update formatting to comply with style policy for DD4hep files style: clang-format DD4hep integration files for dd4hep_integration merge Apr 7, 2026
Copilot AI requested a review from plexoos April 7, 2026 17:32
@plexoos plexoos marked this pull request as ready for review April 7, 2026 17:35
Copilot AI review requested due to automatic review settings April 7, 2026 17:35
Copy link
Copy Markdown
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

Updates newly introduced DD4hep integration sources to comply with the repository’s .clang-format policy so cpp-linter formatting checks pass cleanly when merging into dd4hep_integration.

Changes:

  • Applied .clang-format (style=file) formatting across the DD4hep plugin action sources/headers.
  • Normalized spacing around parentheses, braces, and macro invocations per repo style.
  • Formatted the DD4hep raindrop example geometry source to the same policy.

Reviewed changes

Copilot reviewed 4 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
dd4hepplugins/DD4hepSensorIdentifier.hh Style-only formatting of the DD4hep-aware sensor identifier helper.
dd4hepplugins/OpticsEvent.hh Style-only formatting of the event action interface.
dd4hepplugins/OpticsEvent.cc Style-only formatting of the event action implementation.
dd4hepplugins/OpticsRun.hh Style-only formatting of the run action interface.
dd4hepplugins/OpticsRun.cc Style-only formatting of the run action implementation.
dd4hepplugins/OpticsSteppingAction.hh Style-only formatting of the stepping action interface.
dd4hepplugins/OpticsSteppingAction.cc Style-only formatting of the stepping action implementation.
dd4hepplugins/examples/geometry/Raindrop_geo.cpp Style-only formatting of the DD4hep example detector construction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@plexoos plexoos merged commit d88a4b5 into dd4hep_integration Apr 7, 2026
7 checks passed
@plexoos plexoos deleted the copilot/clang-format-fixes-for-dd4hep-integration branch April 7, 2026 17:49
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