-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d594e9
commit c5f4a1d
Showing
3 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: check-formatting | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- "*" | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
check-formatting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@main | ||
|
||
- name: Install LLVM and Clang | ||
uses: KyleMayes/[email protected] | ||
with: | ||
version: "17.0" | ||
|
||
- name: Test formatting for all files | ||
working-directory: ${{ github.workspace }} | ||
run: | | ||
export CLANG_FORMAT_BIN="${LLVM_PATH}/bin/clang-format" | ||
./scripts/check-format.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
# Go to repository root | ||
cd "$(dirname "$0")/.." || exit 2 | ||
|
||
CLANG_FORMAT_BIN="${CLANG_FORMAT_BIN:-clang-format}" | ||
|
||
find ./src -iname '*.hpp' -o -iname '*.cpp' | xargs $CLANG_FORMAT_BIN -Werror -ferror-limit=1 --dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters