Add cmake format check to CI (#630)

This commit is contained in:
Jack 2024-01-03 23:10:06 +00:00 committed by GitHub
parent a59c64becd
commit eda88bd170
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

26
.cmake-format.json Normal file
View File

@ -0,0 +1,26 @@
{
"format": {
"line_width": 120,
"tab_size": 4,
"use_tabchars": false,
"fractional_tab_policy": "use-space",
"max_subgroups_hwrap": 2,
"max_pargs_hwrap": 2,
"max_rows_cmdline": 2,
"separate_ctrl_name_with_space": false,
"separate_fn_name_with_space": false,
"dangle_parens": true,
"dangle_align": "child",
"min_prefix_chars": 4,
"max_prefix_chars": 10,
"max_lines_hwrap": 2,
"line_ending": "unix",
"command_case": "canonical",
"keyword_case": "unchanged",
"always_wrap": [],
"enable_sort": true,
"autosort": false,
"require_valid_layout": false,
"layout_passes": {}
}
}

View File

@ -48,3 +48,13 @@ jobs:
extensions: 'h,cpp'
clangFormatVersion: 16
style: file
format-check-cmake-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: puneetmatharu/cmake-format-lint-action@v1.0.4
with:
args: "--in-place"
- run: |
git diff --exit-code