forked from radixdlt/radixdlt-scrypto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.sh
executable file
·39 lines (28 loc) · 922 Bytes
/
check.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -eE
err_report() {
echo "Something went wrong on line $1"
}
trap 'err_report $LINENO' ERR
failed=0
cd "$(dirname "$0")"
packages=$(cat Cargo.toml | \
awk '/members/{flag=1;next} /\]/{flag=0} flag' | \
awk -F '"' '{print $2}')
for package in $packages; do
cargo fmt -p $package --check --quiet ||
{ echo "Code format check FAILED for $package"; failed=1; }
done
packages="
assets/blueprints/radiswap/Cargo.toml \
assets/blueprints/faucet/Cargo.toml \
examples/hello-world/Cargo.toml \
examples/no-std/Cargo.toml \
"
packages+=$(find radix-engine-tests/tests/blueprints -mindepth 2 -maxdepth 2 -type f \( -name Cargo.toml \))
for package in $packages; do
cargo fmt --check --quiet --manifest-path $package ||
{ echo "Code format check FAILED for $package"; failed=1; }
done
[ $failed -eq 0 ] && echo "Code format check passed!"
exit $failed