Skip to content

Add cmake-format#409

Open
nkoukpaizan wants to merge 5 commits into
developfrom
nicholson/cmake-format
Open

Add cmake-format#409
nkoukpaizan wants to merge 5 commits into
developfrom
nicholson/cmake-format

Conversation

@nkoukpaizan
Copy link
Copy Markdown
Collaborator

@nkoukpaizan nkoukpaizan commented May 20, 2026

Description

This add cmake-format hooks to harmonize CMake files.

I noticed the need for manual formatting in #394. I thought we had added this at the same time as Re::Solve, but it must have slipped through the cracks.

Proposed changes

  • Added .cmake-format.py. I tried to match the existing style as much as possible.
  • Added cmake-format hook to .pre-commit-config.yaml.
  • CI should modify CMake files accordingly.

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • [N/A] The new code follows GridKit™ style guidelines.
  • [N/A] There are unit tests for the new code.
  • [n/A] The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • I have updated CHANGELOG.md to reflect the changes in this PR. If this is a minor PR that is part of a larger fix already included in the file, state so.

Further comments

Formatting-only changes.

@nkoukpaizan nkoukpaizan self-assigned this May 20, 2026
@nkoukpaizan nkoukpaizan added development Features/Tools related to development of GridKit, rather than use as a library. cmake labels May 20, 2026
@nkoukpaizan nkoukpaizan force-pushed the nicholson/cmake-format branch 14 times, most recently from c28049e to a32e319 Compare May 20, 2026 21:23
Comment on lines +2 to +5
target_link_libraries(PDSim
PUBLIC
GridKit::phasor_dynamics_components
GridKit::solvers_dyn
GridKit::Utilities
GridKit::testing)
target_include_directories(PDSim PRIVATE
${GRIDKIT_THIRD_PARTY_DIR}/nlohmann-json/include
${GRIDKIT_THIRD_PARTY_DIR}/magic-enum/include)
target_link_libraries(PDSim PUBLIC GridKit::phasor_dynamics_components GridKit::solvers_dyn
GridKit::Utilities GridKit::testing)
target_include_directories(PDSim PRIVATE ${GRIDKIT_THIRD_PARTY_DIR}/nlohmann-json/include
${GRIDKIT_THIRD_PARTY_DIR}/magic-enum/include)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a way to have it place elements one-per-line for lists that are too long? It's harder to read like this.

Copy link
Copy Markdown
Collaborator Author

@nkoukpaizan nkoukpaizan May 20, 2026

Choose a reason for hiding this comment

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

I agree. Still working on it.

Copy link
Copy Markdown
Collaborator Author

@nkoukpaizan nkoukpaizan May 21, 2026

Choose a reason for hiding this comment

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

It should be better now!

@nkoukpaizan nkoukpaizan force-pushed the nicholson/cmake-format branch 6 times, most recently from 0188cba to eaafc29 Compare May 20, 2026 22:32
@nkoukpaizan nkoukpaizan force-pushed the nicholson/cmake-format branch from d36c31e to 21cca92 Compare May 20, 2026 22:41
@nkoukpaizan nkoukpaizan force-pushed the nicholson/cmake-format branch from ca7fa5f to 4316bbf Compare May 21, 2026 14:30
@nkoukpaizan nkoukpaizan requested a review from pelesh May 21, 2026 14:34
@nkoukpaizan nkoukpaizan marked this pull request as ready for review May 21, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmake development Features/Tools related to development of GridKit, rather than use as a library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants