1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

fix clang-format script

This commit is contained in:
dark64 2020-04-07 16:02:18 +02:00
parent 07041e92e2
commit 2af231bf3b
2 changed files with 5 additions and 13 deletions

View file

@ -43,8 +43,8 @@ jobs:
keys:
- v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
# - run:
# name: Check format
# command: rustup component add rustfmt; cargo fmt --all -- --check
# name: Check format
# command: rustup component add rustfmt; cargo fmt --all -- --check
- run:
name: Install libsnark prerequisites
command: ./scripts/install_libsnark_prerequisites.sh
@ -155,6 +155,7 @@ workflows:
requires:
- build
- test
- cpp_test
- wasm_test
- integration_test
- zokrates_js_build

13
scripts/clang-format.sh Normal file → Executable file
View file

@ -1,17 +1,8 @@
#!/bin/bash
# Usage: ./clang-format.sh zokrates_core/lib
dir=$1
ret=0
for file in $dir/*.cpp $dir/*.hpp; do
clang-format -i -style=WebKit -verbose $file
out=$(git diff --exit-code $file)
if [ $? -ne 0 ]; then
ret=1
echo "ERROR: clang-format diff in: $file"
echo "$out"
fi
done
exit $ret
done