Skip to content

Commit 73a8793

Browse files
committed
Add fmt check for rust and cpp files
1 parent 6cb149b commit 73a8793

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

.clang-format

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
BasedOnStyle: LLVM
2-
LineEnding: LF
2+
DeriveLineEnding: false
3+
UseCRLF: false

.github/workflows/basic.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,20 @@ jobs:
5454
printenv | grep -E '^(PATH|LD_LIBRARY_PATH|LIBRARY_PATH|CPATH|C_INCLUDE_PATH|CPLUS_INCLUDE_PATH)=' >> $GITHUB_ENV
5555
icx --version
5656
sycl-ls --verbose
57-
57+
58+
- name: Check formatting
59+
run: cargo fmt --all -- --check
60+
61+
- name: Install clang-format
62+
run: |
63+
sudo apt-get update
64+
sudo apt-get install --yes clang-format
65+
66+
- name: Check C++ formatting
67+
run: |
68+
git ls-files -z -- ':(glob)**/*.cpp' ':(glob)**/*.hpp' ':(glob)**/*.h' \
69+
| xargs -0 --no-run-if-empty clang-format --dry-run --Werror
70+
5871
- name: Build
5972
run: cargo build --verbose
6073

0 commit comments

Comments
 (0)