From 40410c2d603b5d047cfcc7d8fab9f6d6c277b731 Mon Sep 17 00:00:00 2001 From: Marco Ferrari Date: Sun, 11 Aug 2024 23:18:33 +0200 Subject: [PATCH] fix: use cargo clippy instead of cargo-clippy (#5988) The cargo-clippy command has been depreacted since Cargo v1.78.0. This is needed to unblock the implementation of fix mode. --- lib/functions/linterCommands.sh | 2 +- scripts/linterVersions.sh | 2 +- test/inspec/super-linter/controls/super_linter.rb | 2 +- test/run-super-linter-tests.sh | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/functions/linterCommands.sh b/lib/functions/linterCommands.sh index 99e63b0c..155a1d62 100755 --- a/lib/functions/linterCommands.sh +++ b/lib/functions/linterCommands.sh @@ -120,7 +120,7 @@ LINTER_COMMANDS_ARRAY_RUBY=(rubocop -c "${RUBY_LINTER_RULES}" --force-exclusion LINTER_COMMANDS_ARRAY_RUST_2015=(rustfmt --edition 2015) LINTER_COMMANDS_ARRAY_RUST_2018=(rustfmt --edition 2018) LINTER_COMMANDS_ARRAY_RUST_2021=(rustfmt --edition 2021) -LINTER_COMMANDS_ARRAY_RUST_CLIPPY=(cargo-clippy) +LINTER_COMMANDS_ARRAY_RUST_CLIPPY=(cargo clippy) LINTER_COMMANDS_ARRAY_SCALAFMT=(scalafmt --config "${SCALAFMT_LINTER_RULES}") LINTER_COMMANDS_ARRAY_SHELL_SHFMT=(shfmt) LINTER_COMMANDS_ARRAY_SNAKEMAKE_LINT=(snakemake --lint -s) diff --git a/scripts/linterVersions.sh b/scripts/linterVersions.sh index 7f5b305c..ebc93e1d 100755 --- a/scripts/linterVersions.sh +++ b/scripts/linterVersions.sh @@ -109,7 +109,7 @@ for LINTER in "${LINTER_NAMES_ARRAY[@]}"; do elif [[ ${LINTER} == "checkstyle" ]] || [[ ${LINTER} == "google-java-format" ]]; then GET_VERSION_CMD="$(java -jar "/usr/bin/${LINTER}" --version 2>&1)" elif [[ ${LINTER} == "clippy" ]]; then - GET_VERSION_CMD="$(cargo-clippy --version 2>&1)" + GET_VERSION_CMD="$(cargo clippy --version 2>&1)" elif [[ ${LINTER} == "editorconfig-checker" ]]; then GET_VERSION_CMD="$(${LINTER} -version)" elif [[ ${LINTER} == "kubeconform" ]]; then diff --git a/test/inspec/super-linter/controls/super_linter.rb b/test/inspec/super-linter/controls/super_linter.rb index f0e7812e..1cec3c13 100644 --- a/test/inspec/super-linter/controls/super_linter.rb +++ b/test/inspec/super-linter/controls/super_linter.rb @@ -143,7 +143,7 @@ control "super-linter-installed-commands" do { linter_name: "checkstyle", version_command: "java -jar /usr/bin/checkstyle --version"}, { linter_name: "chktex"}, { linter_name: "clang-format"}, - { linter_name: "clippy", linter_command: "cargo-clippy"}, + { linter_name: "clippy", linter_command: "cargo clippy"}, { linter_name: "clj-kondo"}, { linter_name: "coffeelint"}, { linter_name: "composer"}, diff --git a/test/run-super-linter-tests.sh b/test/run-super-linter-tests.sh index dc066061..b01bc0fe 100755 --- a/test/run-super-linter-tests.sh +++ b/test/run-super-linter-tests.sh @@ -184,7 +184,8 @@ run_test_case_fix_mode() { COMMAND_TO_RUN+=(--env FIX_RUST_2015="true") COMMAND_TO_RUN+=(--env FIX_RUST_2018="true") COMMAND_TO_RUN+=(--env FIX_RUST_2021="true") - COMMAND_TO_RUN+=(--env FIX_RUST_CLIPPY="true") + # Temporarily disable fix mode for rust clippy due to a dependency on another PR + # COMMAND_TO_RUN+=(--env FIX_RUST_CLIPPY="true") COMMAND_TO_RUN+=(--env FIX_SCALAFMT="true") COMMAND_TO_RUN+=(--env FIX_SHELL_SHFMT="true") COMMAND_TO_RUN+=(--env FIX_SNAKEMAKE_SNAKEFMT="true")