fix many issues with this repo
All checks were successful
check-formatting / check-formatting (push) Successful in 4m8s
All checks were successful
check-formatting / check-formatting (push) Successful in 4m8s
This commit is contained in:
8
scripts/check-format.sh
Executable file
8
scripts/check-format.sh
Executable file
@ -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
|
14
scripts/format.sh
Normal file
14
scripts/format.sh
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Navigate to the repository root
|
||||
cd "$(dirname "$0")/.." || exit 2
|
||||
|
||||
# Set the clang-format binary (defaults to 'clang-format')
|
||||
CLANG_FORMAT_BIN="${CLANG_FORMAT_BIN:-clang-format}"
|
||||
|
||||
# Find and format all .hpp and .cpp files in the src directory
|
||||
find ./src \( -iname '*.hpp' -o -iname '*.cpp' \) -print0 |
|
||||
xargs -0 "$CLANG_FORMAT_BIN" -i || {
|
||||
echo "Error: clang-format failed." >&2
|
||||
exit 1
|
||||
}
|
Reference in New Issue
Block a user