Skip to content

Commit

Permalink
Add a cmake formatting tool in the CI (#670)
Browse files Browse the repository at this point in the history
* Add a cmake formatting tool in the CI

* Fix cmake files format

* Review of cedricchevalier19, adding a contributing note about formatting with a formatting configuration file
  • Loading branch information
tpadioleau authored Oct 30, 2024
1 parent 575480e commit 7b26395
Show file tree
Hide file tree
Showing 11 changed files with 364 additions and 347 deletions.
9 changes: 9 additions & 0 deletions .gersemirc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (C) The DDC development team, see COPYRIGHT.md file
#
# SPDX-License-Identifier: MIT

# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/0.17.0/gersemi/configuration.schema.json

definitions: ["cmake"]
indent: 4
line_length: 100
19 changes: 19 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ jobs:
if: always()
uses: fsfe/reuse-action@v4

cmake-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install python3 virtual environments
run: |
sudo apt-get update
sudo apt-get --yes install python3-pip python3-venv
- name: Install gersemi
run: |
python3 -m venv ./gersemi
. ./gersemi/bin/activate
python3 -m pip install gersemi==0.17
- name: Run gersemi
run: |
. ./gersemi/bin/activate
gersemi --check cmake/DDCVendorConfiguration.cmake
find CMakeLists.txt tests/ examples/ benchmarks/ -name 'CMakeLists.txt' -exec gersemi --check '{}' '+'
id_repo:
runs-on: ubuntu-latest
steps:
Expand Down
Loading

0 comments on commit 7b26395

Please sign in to comment.