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:
|
keys:
|
||||||
- v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
|
- v4-cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }}
|
||||||
# - run:
|
# - run:
|
||||||
# name: Check format
|
# name: Check format
|
||||||
# command: rustup component add rustfmt; cargo fmt --all -- --check
|
# command: rustup component add rustfmt; cargo fmt --all -- --check
|
||||||
- run:
|
- run:
|
||||||
name: Install libsnark prerequisites
|
name: Install libsnark prerequisites
|
||||||
command: ./scripts/install_libsnark_prerequisites.sh
|
command: ./scripts/install_libsnark_prerequisites.sh
|
||||||
|
@ -155,6 +155,7 @@ workflows:
|
||||||
requires:
|
requires:
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
- cpp_test
|
||||||
- wasm_test
|
- wasm_test
|
||||||
- integration_test
|
- integration_test
|
||||||
- zokrates_js_build
|
- 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
|
#!/bin/bash
|
||||||
|
# Usage: ./clang-format.sh zokrates_core/lib
|
||||||
|
|
||||||
dir=$1
|
dir=$1
|
||||||
ret=0
|
|
||||||
|
|
||||||
for file in $dir/*.cpp $dir/*.hpp; do
|
for file in $dir/*.cpp $dir/*.hpp; do
|
||||||
clang-format -i -style=WebKit -verbose $file
|
clang-format -i -style=WebKit -verbose $file
|
||||||
out=$(git diff --exit-code $file)
|
done
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
ret=1
|
|
||||||
echo "ERROR: clang-format diff in: $file"
|
|
||||||
echo "$out"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
exit $ret
|
|
Loading…
Reference in a new issue