-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(clippy): fix lints and improve clippy script
- Loading branch information
1 parent
03e3fbf
commit 3fc369a
Showing
9 changed files
with
116 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,15 +17,8 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: risc0/risc0/.github/actions/[email protected] | ||
|
||
- uses: risc0/risc0/.github/actions/[email protected] | ||
|
||
- uses: risc0/clippy-action@main | ||
with: | ||
reporter: 'github-pr-check' | ||
fail_on_error: true | ||
clippy_flags: --workspace --all-targets --all-features -- -D warnings | ||
- name: Run clippy check for all targets | ||
run: make clippy | ||
|
||
fmt: | ||
name: fmt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Any error will result in failure | ||
set -e | ||
|
||
TOOLCHAIN_RISC0=+nightly-2024-04-18 | ||
TOOLCHAIN_SP1=+nightly-2024-04-18 | ||
TOOLCHAIN_SGX=+nightly-2024-04-18 | ||
|
||
check_toolchain() { | ||
local TOOLCHAIN=$1 | ||
|
||
# Remove the plus sign from the toolchain name | ||
TOOLCHAIN=${TOOLCHAIN#+} | ||
|
||
# Function to check if the toolchain is installed | ||
exist() { | ||
rustup toolchain list | grep "$TOOLCHAIN" >/dev/null | ||
} | ||
|
||
# Main script logic | ||
if exist; then | ||
echo "Toolchain $TOOLCHAIN exists" | ||
else | ||
echo "Installing Rust toolchain: $TOOLCHAIN" | ||
rustup install "$TOOLCHAIN" | ||
fi | ||
} | ||
|
||
# NATIVE | ||
if [ -z "$1" ] || [ "$1" == "native" ]; then | ||
cargo clippy -- -D warnings | ||
fi | ||
|
||
# SGX | ||
if [ -z "$1" ] || [ "$1" == "sgx" ]; then | ||
check_toolchain $TOOLCHAIN_SGX | ||
cargo ${TOOLCHAIN_SGX} clippy -p raiko-host -p sgx-prover -F "sgx enable" -- -D warnings | ||
fi | ||
|
||
# SP1 | ||
if [ -z "$1" ] || [ "$1" == "sp1" ]; then | ||
check_toolchain $TOOLCHAIN_SP1 | ||
cargo ${TOOLCHAIN_SP1} clippy -p raiko-host -p sp1-builder -p sp1-driver -F "sp1 enable" | ||
fi | ||
|
||
# RISC0 | ||
if [ -z "$1" ] || [ "$1" == "risc0" ]; then | ||
check_toolchain $TOOLCHAIN_RISC0 | ||
./script/setup-bonsai.sh | ||
cargo ${TOOLCHAIN_RISC0} clippy -p raiko-host -p risc0-builder -p risc0-driver -F "risc0 enable" | ||
fi |