From c770a8d253f8b8852fd3404b63b807d93cc3691a Mon Sep 17 00:00:00 2001 From: Marco Ferrari Date: Wed, 10 Jul 2024 15:50:15 +0200 Subject: [PATCH] feat: enable dotenv-linter for slim images (#5868) Set up dotenv-linter for the slim image, and not only for the standard image because it doesn't have dependencies on the Rust SDK, and weights less than 10MB. --- .github/workflows/ci.yml | 8 ++++---- Dockerfile | 10 +++++----- README.md | 1 - scripts/linterVersions.sh | 2 +- test/inspec/super-linter/controls/super_linter.rb | 1 - 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 884d304c..f1bdca70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,6 +105,10 @@ jobs: run: | docker load <"/tmp/${{ env.CONTAINER_IMAGE_OUTPUT_IMAGE_NAME }}.tar" + - name: Print environment info + run: | + make info + # Validate the container image labels here so we don't have to pass the expected # label values to other build jobs - name: Validate container image labels @@ -152,10 +156,6 @@ jobs: docker load --input /tmp/${{ env.CONTAINER_IMAGE_OUTPUT_IMAGE_NAME }}.tar docker image ls -a - - name: Print environment info - run: | - make info - - name: Update action.yml run: | echo "yq version: $(yq --version)" diff --git a/Dockerfile b/Dockerfile index 6b9e78ff..f8839da2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -386,6 +386,11 @@ COPY --from=lintr-installer /usr/lib/R /usr/lib/R ##################### COPY --chmod=555 scripts/bash-exec.sh /usr/bin/bash-exec +######################### +# Install dotenv-linter # +######################### +COPY --from=dotenv-linter /dotenv-linter /usr/bin/ + ######################### # Configure Environment # ######################### @@ -465,11 +470,6 @@ RUN apk add --no-cache \ COPY scripts/clippy.sh /usr/bin/clippy RUN chmod +x /usr/bin/clippy -######################### -# Install dotenv-linter # -######################### -COPY --from=dotenv-linter /dotenv-linter /usr/bin/ - ################################### # Install DotNet and Dependencies # ################################### diff --git a/README.md b/README.md index ebfd7b93..274c4d1f 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,6 @@ Super-Linter provides several variants: - `slim`: `super-linter/super-linter/slim@[VERSION]`: includes all supported linters except: - `rust` linters - - `dotenv` linters - `armttk` linters - `pwsh` linters - `c#` linters diff --git a/scripts/linterVersions.sh b/scripts/linterVersions.sh index 2f0e4239..7f5b305c 100755 --- a/scripts/linterVersions.sh +++ b/scripts/linterVersions.sh @@ -20,6 +20,7 @@ LINTER_NAMES_ARRAY['CSS']="stylelint" LINTER_NAMES_ARRAY['DART']="dart" LINTER_NAMES_ARRAY['DOCKERFILE_HADOLINT']="hadolint" LINTER_NAMES_ARRAY['EDITORCONFIG']="editorconfig-checker" +LINTER_NAMES_ARRAY['ENV']="dotenv-linter" LINTER_NAMES_ARRAY['GITHUB_ACTIONS']="actionlint" LINTER_NAMES_ARRAY['GITLEAKS']="gitleaks" LINTER_NAMES_ARRAY['GHERKIN']="gherkin-lint" @@ -82,7 +83,6 @@ LINTER_NAMES_ARRAY['YAML']="yamllint" if [[ "${IMAGE}" == "standard" ]]; then LINTER_NAMES_ARRAY['ARM']="arm-ttk" LINTER_NAMES_ARRAY['CSHARP']="dotnet" - LINTER_NAMES_ARRAY['ENV']="dotenv-linter" LINTER_NAMES_ARRAY['POWERSHELL']="pwsh" LINTER_NAMES_ARRAY['RUST_2015']="rustfmt" LINTER_NAMES_ARRAY['RUST_2018']="rustfmt" diff --git a/test/inspec/super-linter/controls/super_linter.rb b/test/inspec/super-linter/controls/super_linter.rb index 9e0063d8..62a2eeec 100644 --- a/test/inspec/super-linter/controls/super_linter.rb +++ b/test/inspec/super-linter/controls/super_linter.rb @@ -214,7 +214,6 @@ control "super-linter-installed-commands" do arm-ttk clippy dotnet - dotenv-linter pwsh rustfmt )