diff --git a/.gitignore b/.gitignore index 68cb10fa..a7adee70 100644 --- a/.gitignore +++ b/.gitignore @@ -95,3 +95,4 @@ test/linters/rust_clippy/**/target/** super-linter-output/ custom-super-linter-output-directory-name/ super-linter-github-actions-step-summary-output* +github-step-summary.md diff --git a/Dockerfile b/Dockerfile index 4be47068..7bcc9eb4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -467,9 +467,6 @@ RUN apk add --no-cache \ rust-clippy \ rustfmt -COPY scripts/clippy.sh /usr/bin/clippy -RUN chmod +x /usr/bin/clippy - ################################### # Install DotNet and Dependencies # ################################### diff --git a/lib/functions/linterCommands.sh b/lib/functions/linterCommands.sh index 4da569a2..74213eca 100755 --- a/lib/functions/linterCommands.sh +++ b/lib/functions/linterCommands.sh @@ -113,7 +113,8 @@ LINTER_COMMANDS_ARRAY_RUBY=(rubocop -c "${RUBY_LINTER_RULES}" --force-exclusion LINTER_COMMANDS_ARRAY_RUST_2015=(rustfmt --check --edition 2015) LINTER_COMMANDS_ARRAY_RUST_2018=(rustfmt --check --edition 2018) LINTER_COMMANDS_ARRAY_RUST_2021=(rustfmt --check --edition 2021) -LINTER_COMMANDS_ARRAY_RUST_CLIPPY=(clippy) +# Consume the input as we do with ANSIBLE +LINTER_COMMANDS_ARRAY_RUST_CLIPPY=(cargo-clippy "&& echo \"Linted: {}\"") LINTER_COMMANDS_ARRAY_SCALAFMT=(scalafmt --config "${SCALAFMT_LINTER_RULES}" --test) LINTER_COMMANDS_ARRAY_SHELL_SHFMT=(shfmt -d) LINTER_COMMANDS_ARRAY_SNAKEMAKE_LINT=(snakemake --lint -s) diff --git a/lib/functions/worker.sh b/lib/functions/worker.sh index 4c70b684..84184eb9 100755 --- a/lib/functions/worker.sh +++ b/lib/functions/worker.sh @@ -128,6 +128,7 @@ function LintCodebase() { if [[ ${FILE_TYPE} == "CSHARP" ]] || [[ (${FILE_TYPE} == "R" && -f "$(dirname "${FILE}")/.lintr") ]] || [[ ${FILE_TYPE} == "KOTLIN" ]] || + [[ ${FILE_TYPE} == "RUST_CLIPPY" ]] || [[ ${FILE_TYPE} == "TERRAFORM_TFLINT" ]]; then LINTER_WORKING_DIRECTORY="{//}" elif [[ ${FILE_TYPE} == "ANSIBLE" ]] || diff --git a/scripts/clippy.sh b/scripts/clippy.sh deleted file mode 100755 index 0665cc14..00000000 --- a/scripts/clippy.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -pushd "$(dirname "$1")" || exit 1 - -cargo-clippy - -rc=$? - -popd || exit 1 - -exit $rc diff --git a/test/inspec/super-linter/controls/super_linter.rb b/test/inspec/super-linter/controls/super_linter.rb index 919e8ed2..5baec988 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: "clippy", version_command: "cargo-clippy --version"}, + { linter_name: "clippy", linter_command: "cargo-clippy"}, { linter_name: "clj-kondo"}, { linter_name: "coffeelint"}, { linter_name: "composer"},