Skip to content

Commit

Permalink
fix: use cargo clippy instead of cargo-clippy (#5988)
Browse files Browse the repository at this point in the history
The cargo-clippy command has been depreacted since Cargo
v1.78.0. This is needed to unblock the implementation of fix mode.
  • Loading branch information
ferrarimarco authored Aug 11, 2024
1 parent d0219e3 commit 40410c2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/functions/linterCommands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion scripts/linterVersions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/inspec/super-linter/controls/super_linter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
{ 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"},
Expand Down
3 changes: 2 additions & 1 deletion test/run-super-linter-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 40410c2

Please sign in to comment.