fix clang-format script
This commit is contained in:
parent
07041e92e2
commit
2af231bf3b
2 changed files with 5 additions and 13 deletions
|
@ -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
13
scripts/clang-format.sh
Normal file → Executable 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
|
Loading…
Reference in a new issue