Skip to content

Commit

Permalink
Review of cedricchevalier19, adding a contributing note about formatt…
Browse files Browse the repository at this point in the history
…ing with a formatting configuration file
  • Loading branch information
tpadioleau committed Oct 30, 2024
1 parent a5d2d87 commit 74ba323
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .gersemirc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/0.17.0/gersemi/configuration.schema.json

definitions: ["cmake"]
indent: 4
line_length: 100
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ jobs:
run: |
python3 -m venv ./gersemi
. ./gersemi/bin/activate
python3 -m pip install gersemi
python3 -m pip install gersemi==0.17
- name: Run gersemi
run: |
. ./gersemi/bin/activate
gersemi --line-length 100 --indent 4 --check cmake/DDCVendorConfiguration.cmake
find CMakeLists.txt tests/ examples/ benchmarks/ -name 'CMakeLists.txt' -exec gersemi --definitions $PWD/cmake --line-length 100 --indent 4 --check '{}' '+'
gersemi --check cmake/DDCVendorConfiguration.cmake
find CMakeLists.txt tests/ examples/ benchmarks/ -name 'CMakeLists.txt' -exec gersemi --check '{}' '+'
id_repo:
runs-on: ubuntu-latest
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,28 @@ cd ddc
cmake -B build -D DDC_BUILD_KERNELS_FFT=OFF -D DDC_BUILD_KERNELS_SPLINES=OFF -D DDC_BUILD_PDI_WRAPPER=OFF
cmake --build build
```

## Contributing

### Formatting

The project makes use of formatting tools for the C++ ([clang-format](https://clang.llvm.org/docs/ClangFormat.html)) and cmake ([gersemi](https://github.com/BlankSpruce/gersemi)) files. The formatting must be applied for a PR to be accepted.

To format a cmake file, please apply the command

```bash
gersemi -i the-cmake-file
```

One can find the formatting style in the file `.gersemirc`.

To format a C++ file, please apply the command

```bash
clang-format -i the-cpp-file
```

One can find the formatting style in the file `.clang-format`.

> [!WARNING]
> The formatting might not give the same result with different versions of a tool.

0 comments on commit 74ba323

Please sign in to comment.