Skip to content

Commit

Permalink
refactor(clippy): use build script instead of separate clippy script
Browse files Browse the repository at this point in the history
  • Loading branch information
petarvujovic98 committed Jun 18, 2024
1 parent 7b4f5ca commit cda71ca
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 61 deletions.
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ fmt:

clippy:
./script/install.sh $(TARGET)
./script/clippy.sh $(TARGET)
CLIPPY=1 ./script/build.sh $(TARGET)
20 changes: 16 additions & 4 deletions script/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ fi

# NATIVE
if [ -z "$1" ] || [ "$1" == "native" ]; then
if [ -z "${RUN}" ]; then
if [ -n "${CLIPPY}" ]; then
cargo clippy -- -D warnings
elif [ -z "${RUN}" ]; then
if [ -z "${TEST}" ]; then
echo "Building native prover"
cargo build ${FLAGS}
Expand All @@ -72,7 +74,9 @@ if [ -z "$1" ] || [ "$1" == "sgx" ]; then
export SGX_DIRECT=1
echo "SGX_DIRECT is set to $SGX_DIRECT"
fi
if [ -z "${RUN}" ]; then
if [ -n "${CLIPPY}" ]; then
cargo ${TOOLCHAIN_SGX} clippy -p raiko-host -p sgx-prover -F "sgx enable" -- -D warnings
elif [ -z "${RUN}" ]; then
if [ -z "${TEST}" ]; then
echo "Building SGX prover"
cargo ${TOOLCHAIN_SGX} build ${FLAGS} --features sgx
Expand All @@ -99,7 +103,13 @@ if [ -z "$1" ] || [ "$1" == "risc0" ]; then
export RISC0_DEV_MODE=1
echo "RISC0_DEV_MODE is set to $RISC0_DEV_MODE"
fi
if [ -z "${RUN}" ]; then
if [ -n "${CLIPPY}" ]; then
MOCK=1
RISC0_DEV_MODE=1
CI=1
cargo ${TOOLCHAIN_RISC0} run --bin risc0-builder
cargo ${TOOLCHAIN_RISC0} clippy -F risc0
elif [ -z "${RUN}" ]; then
if [ -z "${TEST}" ]; then
echo "Building Risc0 prover"
cargo ${TOOLCHAIN_RISC0} run --bin risc0-builder
Expand Down Expand Up @@ -127,7 +137,9 @@ if [ -z "$1" ] || [ "$1" == "sp1" ]; then
export SP1_PROVER=mock
echo "SP1_PROVER is set to $SP1_PROVER"
fi
if [ -z "${RUN}" ]; then
if [ -n "${CLIPPY}" ]; then
cargo ${TOOLCHAIN_SP1} clippy -p raiko-host -p sp1-builder -p sp1-driver -F "sp1 enable"
elif [ -z "${RUN}" ]; then
if [ -z "${TEST}" ]; then
echo "Building Sp1 prover"
cargo ${TOOLCHAIN_SP1} run --bin sp1-builder
Expand Down
56 changes: 0 additions & 56 deletions script/clippy.sh

This file was deleted.

0 comments on commit cda71ca

Please sign in to comment.