Skip to content

ci: integrate gersemi to format and lint CMake files (#7346)#7663

Open
ArthPatel1502 wants to merge 1 commit into
OSGeo:mainfrom
ArthPatel1502:format-cmake-7346
Open

ci: integrate gersemi to format and lint CMake files (#7346)#7663
ArthPatel1502 wants to merge 1 commit into
OSGeo:mainfrom
ArthPatel1502:format-cmake-7346

Conversation

@ArthPatel1502

Copy link
Copy Markdown
Contributor

Description

Addresses #7346.

This PR integrates Gersemi into the project's pre-commit pipeline to automatically format and lint CMake layout files (CMakeLists.txt and .cmake files).

Per the maintainer discussion on the tracking issue, Gersemi was chosen over cmake-format because it is actively maintained, supports modern CMake features, and provides an official pre-commit hook interface out of the box.

Changes Made

  • Appended the BlankSpruce/gersemi-pre-commit hook repository to .pre-commit-config.yaml.
  • Configured it to run automatically on any staged files during pre-commit checks.

Verification Plan

  1. Ran pre-commit clean to clear localized hook environment definitions.
  2. Evaluated configuration robustness globally via pre-commit run gersemi --all-files.

@github-actions github-actions Bot added the CI Continuous integration label Jul 10, 2026
@echoix

echoix commented Jul 10, 2026

Copy link
Copy Markdown
Member

Ok, nice, can you apply the changes as you mentioned you did in your verification plan? As such, we’ll see how the changes and formatting looks like

@echoix

echoix commented Jul 10, 2026

Copy link
Copy Markdown
Member

And possibly add our definitions if needed

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

Labels

CI Continuous integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants