Skip to content

Commit

Permalink
Do not use --all-features on libafl_qemu
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcondiro committed Sep 9, 2024
1 parent 6703e2f commit 1c34d86
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions scripts/clippy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ set -e
# Function to run Clippy on a single directory
run_clippy() {
local dir="$1"
local all_features="$2"
echo "All features: $all_features"
echo "Running Clippy on $dir"
pushd "$dir" || return 1

RUST_BACKTRACE=full cargo +nightly clippy --all --all-features --no-deps --tests --examples --benches -- -Z macro-backtrace \
RUST_BACKTRACE=full cargo +nightly clippy --all $all_features --no-deps --tests --examples --benches -- -Z macro-backtrace \
-D clippy::all \
-D clippy::pedantic \
-W clippy::similar_names \
Expand Down Expand Up @@ -43,6 +45,11 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
)
fi

# Do not use --all-features for the following projects
NO_ALL_FEATURES=(
"libafl_qemu"
)

if [ "$#" -eq 0 ]; then
# No arguments provided, run on all projects
PROJECTS=("${ALL_PROJECTS[@]}")
Expand Down Expand Up @@ -72,8 +79,12 @@ RUST_BACKTRACE=full cargo +nightly clippy --all --all-features --no-deps --tests
for project in "${PROJECTS[@]}"; do
# Trim leading and trailing whitespace
project=$(echo "$project" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
all_features="--all-features"
if [[ " ${NO_ALL_FEATURES[@]} " =~ " ${project} " ]]; then
all_features=""
fi
if [ -d "$project" ]; then
run_clippy "$project"
run_clippy "$project" $all_features
else
echo "Warning: Directory $project does not exist. Skipping."
fi
Expand Down

0 comments on commit 1c34d86

Please sign in to comment.