diff --git a/scripts/clippy-fmt-and-test.sh b/scripts/clippy-fmt-and-test.sh new file mode 100755 index 0000000000..db1fcbadf6 --- /dev/null +++ b/scripts/clippy-fmt-and-test.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +WORKSPACES="benches common protocols roles utils" + +for workspace in $WORKSPACES; do + echo "Executing clippy on: $workspace" + cargo +1.75.0 clippy --manifest-path="$workspace/Cargo.toml" -- -D warnings -A dead-code + if [ $? -ne 0 ]; then + echo "Clippy found some errors in: $workspace" + exit 1 + fi + + echo "Running tests on: $workspace" + cargo +1.75 test --manifest-path="$workspace/Cargo.toml" + if [ $? -ne 0 ]; then + echo "Tests failed in: $workspace" + exit 1 + fi + + echo "Running fmt on: $workspace" + (cd $workspace && cargo +nightly fmt) + if [ $? -ne 0 ]; then + echo "Fmt failed in: $workspace" + exit 1 + fi +done + +echo "Clippy success, all tests passed!" diff --git a/scripts/run_clippy.sh b/scripts/run_clippy.sh deleted file mode 100755 index 0238578a75..0000000000 --- a/scripts/run_clippy.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -for manifest in \ - benches/Cargo.toml \ - common/Cargo.toml \ - protocols/Cargo.toml \ - roles/Cargo.toml \ - utils/Cargo.toml \ - utils/message-generator/Cargo.toml; do - cargo clippy --manifest-path=$manifest -- -D warnings -A dead-code -done diff --git a/scripts/workflows/clippy.sh b/scripts/workflows/clippy.sh index db1fcbadf6..0238578a75 100755 --- a/scripts/workflows/clippy.sh +++ b/scripts/workflows/clippy.sh @@ -1,28 +1,10 @@ -#!/bin/sh - -WORKSPACES="benches common protocols roles utils" - -for workspace in $WORKSPACES; do - echo "Executing clippy on: $workspace" - cargo +1.75.0 clippy --manifest-path="$workspace/Cargo.toml" -- -D warnings -A dead-code - if [ $? -ne 0 ]; then - echo "Clippy found some errors in: $workspace" - exit 1 - fi - - echo "Running tests on: $workspace" - cargo +1.75 test --manifest-path="$workspace/Cargo.toml" - if [ $? -ne 0 ]; then - echo "Tests failed in: $workspace" - exit 1 - fi - - echo "Running fmt on: $workspace" - (cd $workspace && cargo +nightly fmt) - if [ $? -ne 0 ]; then - echo "Fmt failed in: $workspace" - exit 1 - fi +#!/bin/bash +for manifest in \ + benches/Cargo.toml \ + common/Cargo.toml \ + protocols/Cargo.toml \ + roles/Cargo.toml \ + utils/Cargo.toml \ + utils/message-generator/Cargo.toml; do + cargo clippy --manifest-path=$manifest -- -D warnings -A dead-code done - -echo "Clippy success, all tests passed!"