diff --git a/crate/bevy_controls/script/fetures-clippy.sh b/crate/bevy_controls/script/fetures-clippy.sh new file mode 100644 index 0000000..51467ec --- /dev/null +++ b/crate/bevy_controls/script/fetures-clippy.sh @@ -0,0 +1,35 @@ +features=$(grep '^\[features\]' $1 -A99999999 | grep '^\[' -m 2 -B99999999 | grep -v '^\[' | cut -d '=' -f 1 | grep -v 'default') + + +generate_combinations() { + local items=($1) + local size=$2 + local current=$3 + local combination=$4 + + if [ $current -eq $size ]; then + echo "$combination" + return + fi + + for ((i = 0; i < ${#items[@]}; ++i)); do + new_combination="$combination ${items[$i]}" + remaining_items=("${items[@]:0:$i}" "${items[@]:$((i + 1))}") + generate_combinations "$(IFS=" "; echo "${remaining_items[*]}")" $size $((current + 1)) "$new_combination" + done +} + +for ((i = 1; i <= $(wc -w <<< "$features"); ++i)); do + echo "Generating combinations of size $i" + combos=$(generate_combinations "$features" $i 0 "") + echo "$combos" | while read line + do + echo "Running clippy with features: $line" + combo=$(echo $combo | xargs) # Trim + echo "Running clippy with features: $combo" + if ! cargo clippy --features "$combo"; then + echo "Error found in combination: $combo" + exit 1 + fi + done +done \ No newline at end of file diff --git a/crate/bevy_controls/src/contract.rs b/crate/bevy_controls/src/contract.rs index 36e1608..0fe00ad 100644 --- a/crate/bevy_controls/src/contract.rs +++ b/crate/bevy_controls/src/contract.rs @@ -173,4 +173,4 @@ pub trait InputsContainer: InputsContainerInner + SerializeImpl + // } // impl super::Action for Action {} -// } +// } \ No newline at end of file diff --git a/crate/bevy_controls/src/plugin.rs b/crate/bevy_controls/src/plugin.rs index d4be868..2df95b1 100644 --- a/crate/bevy_controls/src/plugin.rs +++ b/crate/bevy_controls/src/plugin.rs @@ -55,7 +55,6 @@ impl< todo!(); } } - break; } match &binding.input {