From c64e1856575694c0bad23c8e80b3a5b820e6a7f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Mon, 27 May 2024 01:58:46 -0400 Subject: [PATCH] Adjust find commands to clean up files in same step (#3588) * clean /venvs folder only through find * Clean Python files after Megalinter install with find * Use a single find call to clean up npm package installation * Clean megalinter install with a single find call in /server * Update build files --- .automation/build.py | 23 ++++++++++--------- Dockerfile | 15 +++--------- flavors/c_cpp/Dockerfile | 15 +++--------- flavors/ci_light/Dockerfile | 15 +++--------- flavors/cupcake/Dockerfile | 15 +++--------- flavors/documentation/Dockerfile | 15 +++--------- flavors/dotnet/Dockerfile | 15 +++--------- flavors/dotnetweb/Dockerfile | 15 +++--------- flavors/formatters/Dockerfile | 15 +++--------- flavors/go/Dockerfile | 15 +++--------- flavors/java/Dockerfile | 15 +++--------- flavors/javascript/Dockerfile | 15 +++--------- flavors/php/Dockerfile | 15 +++--------- flavors/python/Dockerfile | 15 +++--------- flavors/ruby/Dockerfile | 15 +++--------- flavors/rust/Dockerfile | 15 +++--------- flavors/salesforce/Dockerfile | 15 +++--------- flavors/security/Dockerfile | 15 +++--------- flavors/swift/Dockerfile | 15 +++--------- flavors/terraform/Dockerfile | 15 +++--------- linters/action_actionlint/Dockerfile | 2 +- linters/ansible_ansible_lint/Dockerfile | 4 ++-- linters/api_spectral/Dockerfile | 13 ++--------- linters/arm_arm_ttk/Dockerfile | 2 +- linters/bash_exec/Dockerfile | 2 +- linters/bash_shellcheck/Dockerfile | 2 +- linters/bash_shfmt/Dockerfile | 2 +- linters/bicep_bicep_linter/Dockerfile | 2 +- linters/c_clang_format/Dockerfile | 2 +- linters/c_cpplint/Dockerfile | 4 ++-- linters/clojure_clj_kondo/Dockerfile | 2 +- linters/clojure_cljstyle/Dockerfile | 2 +- linters/cloudformation_cfn_lint/Dockerfile | 4 ++-- linters/coffee_coffeelint/Dockerfile | 13 ++--------- linters/copypaste_jscpd/Dockerfile | 13 ++--------- linters/cpp_clang_format/Dockerfile | 2 +- linters/cpp_cpplint/Dockerfile | 4 ++-- linters/csharp_csharpier/Dockerfile | 2 +- linters/csharp_dotnet_format/Dockerfile | 2 +- linters/csharp_roslynator/Dockerfile | 2 +- linters/css_scss_lint/Dockerfile | 2 +- linters/css_stylelint/Dockerfile | 13 ++--------- linters/dart_dartanalyzer/Dockerfile | 2 +- linters/dockerfile_hadolint/Dockerfile | 2 +- .../Dockerfile | 2 +- linters/env_dotenv_linter/Dockerfile | 2 +- linters/gherkin_gherkin_lint/Dockerfile | 13 ++--------- linters/go_golangci_lint/Dockerfile | 2 +- linters/go_revive/Dockerfile | 2 +- .../graphql_graphql_schema_linter/Dockerfile | 13 ++--------- linters/groovy_npm_groovy_lint/Dockerfile | 13 ++--------- linters/html_djlint/Dockerfile | 4 ++-- linters/html_htmlhint/Dockerfile | 13 ++--------- linters/java_checkstyle/Dockerfile | 2 +- linters/java_pmd/Dockerfile | 2 +- linters/javascript_es/Dockerfile | 13 ++--------- linters/javascript_prettier/Dockerfile | 13 ++--------- linters/javascript_standard/Dockerfile | 13 ++--------- linters/json_eslint_plugin_jsonc/Dockerfile | 13 ++--------- linters/json_jsonlint/Dockerfile | 13 ++--------- linters/json_npm_package_json_lint/Dockerfile | 13 ++--------- linters/json_prettier/Dockerfile | 13 ++--------- linters/json_v8r/Dockerfile | 13 ++--------- linters/jsx_eslint/Dockerfile | 13 ++--------- linters/kotlin_detekt/Dockerfile | 2 +- linters/kotlin_ktlint/Dockerfile | 2 +- linters/kubernetes_helm/Dockerfile | 2 +- linters/kubernetes_kubeconform/Dockerfile | 2 +- linters/kubernetes_kubescape/Dockerfile | 2 +- linters/latex_chktex/Dockerfile | 2 +- linters/lua_luacheck/Dockerfile | 2 +- linters/makefile_checkmake/Dockerfile | 2 +- .../markdown_markdown_link_check/Dockerfile | 13 ++--------- .../Dockerfile | 13 ++--------- linters/markdown_markdownlint/Dockerfile | 13 ++--------- linters/markdown_remark_lint/Dockerfile | 13 ++--------- linters/openapi_spectral/Dockerfile | 13 ++--------- linters/perl_perlcritic/Dockerfile | 2 +- linters/php_phpcs/Dockerfile | 2 +- linters/php_phplint/Dockerfile | 2 +- linters/php_phpstan/Dockerfile | 2 +- linters/php_psalm/Dockerfile | 2 +- linters/powershell_powershell/Dockerfile | 2 +- .../Dockerfile | 2 +- linters/protobuf_protolint/Dockerfile | 2 +- linters/puppet_puppet_lint/Dockerfile | 2 +- linters/python_bandit/Dockerfile | 4 ++-- linters/python_black/Dockerfile | 4 ++-- linters/python_flake8/Dockerfile | 4 ++-- linters/python_isort/Dockerfile | 4 ++-- linters/python_mypy/Dockerfile | 4 ++-- linters/python_pylint/Dockerfile | 4 ++-- linters/python_pyright/Dockerfile | 4 ++-- linters/python_ruff/Dockerfile | 4 ++-- linters/r_lintr/Dockerfile | 2 +- linters/raku_raku/Dockerfile | 2 +- linters/repository_checkov/Dockerfile | 4 ++-- linters/repository_devskim/Dockerfile | 2 +- linters/repository_dustilock/Dockerfile | 2 +- linters/repository_git_diff/Dockerfile | 2 +- linters/repository_gitleaks/Dockerfile | 2 +- linters/repository_grype/Dockerfile | 2 +- linters/repository_kics/Dockerfile | 2 +- linters/repository_secretlint/Dockerfile | 13 ++--------- linters/repository_semgrep/Dockerfile | 4 ++-- linters/repository_syft/Dockerfile | 2 +- linters/repository_trivy/Dockerfile | 2 +- linters/repository_trivy_sbom/Dockerfile | 2 +- linters/repository_trufflehog/Dockerfile | 2 +- linters/rst_rst_lint/Dockerfile | 4 ++-- linters/rst_rstcheck/Dockerfile | 4 ++-- linters/rst_rstfmt/Dockerfile | 4 ++-- linters/ruby_rubocop/Dockerfile | 2 +- linters/rust_clippy/Dockerfile | 2 +- .../Dockerfile | 13 ++--------- .../salesforce_sfdx_scanner_apex/Dockerfile | 13 ++--------- .../salesforce_sfdx_scanner_aura/Dockerfile | 13 ++--------- .../salesforce_sfdx_scanner_lwc/Dockerfile | 13 ++--------- linters/scala_scalafix/Dockerfile | 2 +- linters/snakemake_lint/Dockerfile | 4 ++-- linters/snakemake_snakefmt/Dockerfile | 4 ++-- linters/spell_cspell/Dockerfile | 13 ++--------- linters/spell_lychee/Dockerfile | 2 +- linters/spell_proselint/Dockerfile | 4 ++-- linters/spell_vale/Dockerfile | 2 +- linters/sql_sql_lint/Dockerfile | 13 ++--------- linters/sql_sqlfluff/Dockerfile | 4 ++-- linters/sql_tsqllint/Dockerfile | 2 +- linters/swift_swiftlint/Dockerfile | 2 +- linters/tekton_tekton_lint/Dockerfile | 13 ++--------- linters/terraform_terraform_fmt/Dockerfile | 2 +- linters/terraform_terragrunt/Dockerfile | 2 +- linters/terraform_terrascan/Dockerfile | 2 +- linters/terraform_tflint/Dockerfile | 2 +- linters/tsx_eslint/Dockerfile | 13 ++--------- linters/typescript_es/Dockerfile | 13 ++--------- linters/typescript_prettier/Dockerfile | 13 ++--------- linters/typescript_standard/Dockerfile | 13 ++--------- linters/vbdotnet_dotnet_format/Dockerfile | 2 +- linters/xml_xmllint/Dockerfile | 2 +- linters/yaml_prettier/Dockerfile | 13 ++--------- linters/yaml_v8r/Dockerfile | 13 ++--------- linters/yaml_yamllint/Dockerfile | 4 ++-- server/Dockerfile | 2 +- server/Dockerfile-dev | 2 +- 145 files changed, 253 insertions(+), 747 deletions(-) diff --git a/.automation/build.py b/.automation/build.py index 08c71aa9a35..0db61cdd231 100644 --- a/.automation/build.py +++ b/.automation/build.py @@ -522,16 +522,17 @@ def build_dockerfile( + ' && echo "Changing owner of node_modules files…" \\\n' + ' && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \\\n' + ' && echo "Removing extra node_module files…" \\\n' - + " && rm -rf /root/.npm/_cacache \\\n" - + ' && find . -name "*.d.ts" -delete \\\n' - + ' && find . -name "*.map" -delete \\\n' - + ' && find . -name "*.npmignore" -delete \\\n' - + ' && find . -name "*.travis.yml" -delete \\\n' - + ' && find . -name "CHANGELOG.md" -delete \\\n' - + ' && find . -name "README.md" -delete \\\n' - + ' && find . -name ".package-lock.json" -delete \\\n' - + ' && find . -name "package-lock.json" -delete \\\n' - + ' && find . -name "README.md" -delete\n' + + ' && find . \\( -not -path "/proc" \\)' + + ' -and \\( -type f' + + ' \\( -iname "*.d.ts"' + + ' -o -iname "*.map"' + + ' -o -iname "*.npmignore"' + + ' -o -iname "*.travis.yml"' + + ' -o -iname "CHANGELOG.md"' + + ' -o -iname "README.md"' + + ' -o -iname ".package-lock.json"' + + ' -o -iname "package-lock.json"' + + ' \\) -o -type d -name /root/.npm/_cacache \\) -delete \n' + "WORKDIR /\n" ) replace_in_file(dockerfile, "#NPM__START", "#NPM__END", npm_install_command) @@ -571,7 +572,7 @@ def build_dockerfile( pipenv_install_command = pipenv_install_command[:-2] # remove last \ pipenv_install_command += ( " \\\n && " - + r"find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete" + + r"find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete" + " \\\n && " + "rm -rf /root/.cache\n" + env_path_command diff --git a/Dockerfile b/Dockerfile index 71144d5173a..6c1c695792e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -200,7 +200,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/cfn-lint/bin:/venvs/djlint/bin:/venvs/pylint/bin:/venvs/black/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/bandit/bin:/venvs/mypy/bin:/venvs/pyright/bin:/venvs/ruff/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/rst-lint/bin:/venvs/rstcheck/bin:/venvs/rstfmt/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -268,16 +268,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -763,7 +754,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/c_cpp/Dockerfile b/flavors/c_cpp/Dockerfile index fb69b8f7171..a837744d213 100644 --- a/flavors/c_cpp/Dockerfile +++ b/flavors/c_cpp/Dockerfile @@ -137,7 +137,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -179,16 +179,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -324,7 +315,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/ci_light/Dockerfile b/flavors/ci_light/Dockerfile index 3bfa809cc9e..5b6badc5ac5 100644 --- a/flavors/ci_light/Dockerfile +++ b/flavors/ci_light/Dockerfile @@ -107,7 +107,7 @@ ENV PATH="/root/.cargo/bin:${PATH}" #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/yamllint/bin #PIPVENV__END @@ -136,16 +136,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -223,7 +214,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/cupcake/Dockerfile b/flavors/cupcake/Dockerfile index 6072ec42d17..1983f6cc162 100644 --- a/flavors/cupcake/Dockerfile +++ b/flavors/cupcake/Dockerfile @@ -172,7 +172,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/cfn-lint/bin:/venvs/djlint/bin:/venvs/pylint/bin:/venvs/black/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/mypy/bin:/venvs/pyright/bin:/venvs/ruff/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/rst-lint/bin:/venvs/rstcheck/bin:/venvs/rstfmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -235,16 +235,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -523,7 +514,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/documentation/Dockerfile b/flavors/documentation/Dockerfile index ca52f0f5cad..a00081caf95 100644 --- a/flavors/documentation/Dockerfile +++ b/flavors/documentation/Dockerfile @@ -135,7 +135,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -177,16 +177,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -322,7 +313,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/dotnet/Dockerfile b/flavors/dotnet/Dockerfile index c0aa208c3db..2da12592b62 100644 --- a/flavors/dotnet/Dockerfile +++ b/flavors/dotnet/Dockerfile @@ -143,7 +143,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -188,16 +188,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -384,7 +375,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/dotnetweb/Dockerfile b/flavors/dotnetweb/Dockerfile index 4c83577d9f3..3da11e18653 100644 --- a/flavors/dotnetweb/Dockerfile +++ b/flavors/dotnetweb/Dockerfile @@ -143,7 +143,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -210,16 +210,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -406,7 +397,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/formatters/Dockerfile b/flavors/formatters/Dockerfile index edf9a1dad08..dc4f56ebbd9 100644 --- a/flavors/formatters/Dockerfile +++ b/flavors/formatters/Dockerfile @@ -102,7 +102,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/isort" && cd "/venvs/isort" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir isort black && deactivate && cd ./../.. \ && mkdir -p "/venvs/rstfmt" && cd "/venvs/rstfmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir rstfmt && deactivate && cd ./../.. \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/black/bin:/venvs/isort/bin:/venvs/rstfmt/bin:/venvs/snakefmt/bin #PIPVENV__END @@ -127,16 +127,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -211,7 +202,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/go/Dockerfile b/flavors/go/Dockerfile index dae7535e7d7..41fd68813f5 100644 --- a/flavors/go/Dockerfile +++ b/flavors/go/Dockerfile @@ -142,7 +142,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -184,16 +184,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -338,7 +329,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/java/Dockerfile b/flavors/java/Dockerfile index f01ee41c859..1fe1e86bd69 100644 --- a/flavors/java/Dockerfile +++ b/flavors/java/Dockerfile @@ -135,7 +135,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -177,16 +177,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -395,7 +386,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/javascript/Dockerfile b/flavors/javascript/Dockerfile index 8e34e46ba6c..bc161990c74 100644 --- a/flavors/javascript/Dockerfile +++ b/flavors/javascript/Dockerfile @@ -135,7 +135,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -201,16 +201,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -346,7 +337,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/php/Dockerfile b/flavors/php/Dockerfile index 875d6b24aa7..f81d9771524 100644 --- a/flavors/php/Dockerfile +++ b/flavors/php/Dockerfile @@ -149,7 +149,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -191,16 +191,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -372,7 +363,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/python/Dockerfile b/flavors/python/Dockerfile index 2a96c50591c..d4ba783a649 100644 --- a/flavors/python/Dockerfile +++ b/flavors/python/Dockerfile @@ -147,7 +147,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cpplint/bin:/venvs/djlint/bin:/venvs/pylint/bin:/venvs/black/bin:/venvs/flake8/bin:/venvs/isort/bin:/venvs/bandit/bin:/venvs/mypy/bin:/venvs/pyright/bin:/venvs/ruff/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/rst-lint/bin:/venvs/rstcheck/bin:/venvs/rstfmt/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -189,16 +189,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -338,7 +329,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/ruby/Dockerfile b/flavors/ruby/Dockerfile index 96557b6a3de..755e49a9263 100644 --- a/flavors/ruby/Dockerfile +++ b/flavors/ruby/Dockerfile @@ -135,7 +135,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -177,16 +177,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -328,7 +319,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/rust/Dockerfile b/flavors/rust/Dockerfile index 3feee9a1946..77614d5cc72 100644 --- a/flavors/rust/Dockerfile +++ b/flavors/rust/Dockerfile @@ -135,7 +135,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -177,16 +177,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -322,7 +313,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/salesforce/Dockerfile b/flavors/salesforce/Dockerfile index 3f73f88ecdf..397168edcd4 100644 --- a/flavors/salesforce/Dockerfile +++ b/flavors/salesforce/Dockerfile @@ -135,7 +135,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -180,16 +180,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -357,7 +348,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/security/Dockerfile b/flavors/security/Dockerfile index 7671002de42..2776313f353 100644 --- a/flavors/security/Dockerfile +++ b/flavors/security/Dockerfile @@ -116,7 +116,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/bandit" && cd "/venvs/bandit" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir bandit bandit_sarif_formatter bandit[toml] && deactivate && cd ./../.. \ && mkdir -p "/venvs/checkov" && cd "/venvs/checkov" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir packaging checkov && deactivate && cd ./../.. \ && mkdir -p "/venvs/semgrep" && cd "/venvs/semgrep" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir semgrep && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/cfn-lint/bin:/venvs/bandit/bin:/venvs/checkov/bin:/venvs/semgrep/bin #PIPVENV__END @@ -140,16 +140,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -260,7 +251,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/swift/Dockerfile b/flavors/swift/Dockerfile index 2235156d794..fc4378d1554 100644 --- a/flavors/swift/Dockerfile +++ b/flavors/swift/Dockerfile @@ -137,7 +137,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -179,16 +179,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -325,7 +316,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/flavors/terraform/Dockerfile b/flavors/terraform/Dockerfile index 29f3885c3aa..483639dc51a 100644 --- a/flavors/terraform/Dockerfile +++ b/flavors/terraform/Dockerfile @@ -141,7 +141,7 @@ RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtuale && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin:/venvs/djlint/bin:/venvs/checkov/bin:/venvs/semgrep/bin:/venvs/snakemake/bin:/venvs/snakefmt/bin:/venvs/proselint/bin:/venvs/sqlfluff/bin:/venvs/yamllint/bin #PIPVENV__END @@ -183,16 +183,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -351,7 +342,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/action_actionlint/Dockerfile b/linters/action_actionlint/Dockerfile index 32e730f0b04..f499b53d18c 100644 --- a/linters/action_actionlint/Dockerfile +++ b/linters/action_actionlint/Dockerfile @@ -151,7 +151,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/ansible_ansible_lint/Dockerfile b/linters/ansible_ansible_lint/Dockerfile index 4126f72c8fa..4a69d9d7fcb 100644 --- a/linters/ansible_ansible_lint/Dockerfile +++ b/linters/ansible_ansible_lint/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/ansible-lint" && cd "/venvs/ansible-lint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir ansible-lint=='24.2.3' && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ansible-lint/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/api_spectral/Dockerfile b/linters/api_spectral/Dockerfile index 21bcec96f97..01d7534fc88 100644 --- a/linters/api_spectral/Dockerfile +++ b/linters/api_spectral/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/arm_arm_ttk/Dockerfile b/linters/arm_arm_ttk/Dockerfile index 602b88ac354..50704c3f5ad 100644 --- a/linters/arm_arm_ttk/Dockerfile +++ b/linters/arm_arm_ttk/Dockerfile @@ -159,7 +159,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/bash_exec/Dockerfile b/linters/bash_exec/Dockerfile index d04205fc8e0..565f14a8681 100644 --- a/linters/bash_exec/Dockerfile +++ b/linters/bash_exec/Dockerfile @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/bash_shellcheck/Dockerfile b/linters/bash_shellcheck/Dockerfile index 511907528ae..127ce17c679 100644 --- a/linters/bash_shellcheck/Dockerfile +++ b/linters/bash_shellcheck/Dockerfile @@ -146,7 +146,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/bash_shfmt/Dockerfile b/linters/bash_shfmt/Dockerfile index ea253f653ae..5e67885eaff 100644 --- a/linters/bash_shfmt/Dockerfile +++ b/linters/bash_shfmt/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/bicep_bicep_linter/Dockerfile b/linters/bicep_bicep_linter/Dockerfile index 55652611dc6..5df140efc7a 100644 --- a/linters/bicep_bicep_linter/Dockerfile +++ b/linters/bicep_bicep_linter/Dockerfile @@ -148,7 +148,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/c_clang_format/Dockerfile b/linters/c_clang_format/Dockerfile index e095fe384dd..561780a5ce1 100644 --- a/linters/c_clang_format/Dockerfile +++ b/linters/c_clang_format/Dockerfile @@ -141,7 +141,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/c_cpplint/Dockerfile b/linters/c_cpplint/Dockerfile index 7773ca62844..3bff2cdde7d 100644 --- a/linters/c_cpplint/Dockerfile +++ b/linters/c_cpplint/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/cpplint" && cd "/venvs/cpplint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir cpplint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/cpplint/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/clojure_clj_kondo/Dockerfile b/linters/clojure_clj_kondo/Dockerfile index 0a89d2d4284..dd9e348c39c 100644 --- a/linters/clojure_clj_kondo/Dockerfile +++ b/linters/clojure_clj_kondo/Dockerfile @@ -187,7 +187,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/clojure_cljstyle/Dockerfile b/linters/clojure_cljstyle/Dockerfile index 2156c177a57..b357a47a460 100644 --- a/linters/clojure_cljstyle/Dockerfile +++ b/linters/clojure_cljstyle/Dockerfile @@ -187,7 +187,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/cloudformation_cfn_lint/Dockerfile b/linters/cloudformation_cfn_lint/Dockerfile index e6943e95450..9a3f8d7e7df 100644 --- a/linters/cloudformation_cfn_lint/Dockerfile +++ b/linters/cloudformation_cfn_lint/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/cfn-lint" && cd "/venvs/cfn-lint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir cfn-lint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/cfn-lint/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/coffee_coffeelint/Dockerfile b/linters/coffee_coffeelint/Dockerfile index 54c7bc71129..e1f5195eb8b 100644 --- a/linters/coffee_coffeelint/Dockerfile +++ b/linters/coffee_coffeelint/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/copypaste_jscpd/Dockerfile b/linters/copypaste_jscpd/Dockerfile index d10e809e37f..ec470c8eb18 100644 --- a/linters/copypaste_jscpd/Dockerfile +++ b/linters/copypaste_jscpd/Dockerfile @@ -111,16 +111,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -163,7 +154,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/cpp_clang_format/Dockerfile b/linters/cpp_clang_format/Dockerfile index 60cf985f49d..cd3406b1a5a 100644 --- a/linters/cpp_clang_format/Dockerfile +++ b/linters/cpp_clang_format/Dockerfile @@ -141,7 +141,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/cpp_cpplint/Dockerfile b/linters/cpp_cpplint/Dockerfile index 8451d0da762..04339fcc9a6 100644 --- a/linters/cpp_cpplint/Dockerfile +++ b/linters/cpp_cpplint/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/cpplint" && cd "/venvs/cpplint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir cpplint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/cpplint/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/csharp_csharpier/Dockerfile b/linters/csharp_csharpier/Dockerfile index 2c5ef6bc47c..d90f5a39998 100644 --- a/linters/csharp_csharpier/Dockerfile +++ b/linters/csharp_csharpier/Dockerfile @@ -146,7 +146,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/csharp_dotnet_format/Dockerfile b/linters/csharp_dotnet_format/Dockerfile index 91baa009f9a..6b4f73100c2 100644 --- a/linters/csharp_dotnet_format/Dockerfile +++ b/linters/csharp_dotnet_format/Dockerfile @@ -143,7 +143,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/csharp_roslynator/Dockerfile b/linters/csharp_roslynator/Dockerfile index 41db3cd3d6f..b8bb670d786 100644 --- a/linters/csharp_roslynator/Dockerfile +++ b/linters/csharp_roslynator/Dockerfile @@ -146,7 +146,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/css_scss_lint/Dockerfile b/linters/css_scss_lint/Dockerfile index d51ee9ea096..c34128a5e67 100644 --- a/linters/css_scss_lint/Dockerfile +++ b/linters/css_scss_lint/Dockerfile @@ -146,7 +146,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/css_stylelint/Dockerfile b/linters/css_stylelint/Dockerfile index 034c5d48505..b2f75e642af 100644 --- a/linters/css_stylelint/Dockerfile +++ b/linters/css_stylelint/Dockerfile @@ -113,16 +113,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -165,7 +156,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/dart_dartanalyzer/Dockerfile b/linters/dart_dartanalyzer/Dockerfile index bf01c9bf5ff..2de08cb6bfb 100644 --- a/linters/dart_dartanalyzer/Dockerfile +++ b/linters/dart_dartanalyzer/Dockerfile @@ -188,7 +188,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/dockerfile_hadolint/Dockerfile b/linters/dockerfile_hadolint/Dockerfile index 445f7973b6c..8e4c61bb716 100644 --- a/linters/dockerfile_hadolint/Dockerfile +++ b/linters/dockerfile_hadolint/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/editorconfig_editorconfig_checker/Dockerfile b/linters/editorconfig_editorconfig_checker/Dockerfile index 6d5ce96b467..41b14bb20e8 100644 --- a/linters/editorconfig_editorconfig_checker/Dockerfile +++ b/linters/editorconfig_editorconfig_checker/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/env_dotenv_linter/Dockerfile b/linters/env_dotenv_linter/Dockerfile index c14ce30e29d..508499da820 100644 --- a/linters/env_dotenv_linter/Dockerfile +++ b/linters/env_dotenv_linter/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/gherkin_gherkin_lint/Dockerfile b/linters/gherkin_gherkin_lint/Dockerfile index 9d4096dc652..5937028a6ea 100644 --- a/linters/gherkin_gherkin_lint/Dockerfile +++ b/linters/gherkin_gherkin_lint/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/go_golangci_lint/Dockerfile b/linters/go_golangci_lint/Dockerfile index 53094801ffd..c60ed12e75c 100644 --- a/linters/go_golangci_lint/Dockerfile +++ b/linters/go_golangci_lint/Dockerfile @@ -145,7 +145,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/go_revive/Dockerfile b/linters/go_revive/Dockerfile index 8c15a0f68da..8eb46bc73b4 100644 --- a/linters/go_revive/Dockerfile +++ b/linters/go_revive/Dockerfile @@ -147,7 +147,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/graphql_graphql_schema_linter/Dockerfile b/linters/graphql_graphql_schema_linter/Dockerfile index 32353373c75..b3be3429c75 100644 --- a/linters/graphql_graphql_schema_linter/Dockerfile +++ b/linters/graphql_graphql_schema_linter/Dockerfile @@ -111,16 +111,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -163,7 +154,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/groovy_npm_groovy_lint/Dockerfile b/linters/groovy_npm_groovy_lint/Dockerfile index d7957ae158e..fef13a0b23e 100644 --- a/linters/groovy_npm_groovy_lint/Dockerfile +++ b/linters/groovy_npm_groovy_lint/Dockerfile @@ -111,16 +111,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -165,7 +156,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/html_djlint/Dockerfile b/linters/html_djlint/Dockerfile index a3f0560aa39..aad38ab711d 100644 --- a/linters/html_djlint/Dockerfile +++ b/linters/html_djlint/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/djlint" && cd "/venvs/djlint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir djlint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/djlint/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/html_htmlhint/Dockerfile b/linters/html_htmlhint/Dockerfile index 2ee401d8b1c..fa75eb4e448 100644 --- a/linters/html_htmlhint/Dockerfile +++ b/linters/html_htmlhint/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/java_checkstyle/Dockerfile b/linters/java_checkstyle/Dockerfile index 1eecd11ba8d..0a30af6da7b 100644 --- a/linters/java_checkstyle/Dockerfile +++ b/linters/java_checkstyle/Dockerfile @@ -156,7 +156,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/java_pmd/Dockerfile b/linters/java_pmd/Dockerfile index 225caa00a3a..aa691e2735f 100644 --- a/linters/java_pmd/Dockerfile +++ b/linters/java_pmd/Dockerfile @@ -152,7 +152,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/javascript_es/Dockerfile b/linters/javascript_es/Dockerfile index 2cb9be7df9b..69ac7f91379 100644 --- a/linters/javascript_es/Dockerfile +++ b/linters/javascript_es/Dockerfile @@ -122,16 +122,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -174,7 +165,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/javascript_prettier/Dockerfile b/linters/javascript_prettier/Dockerfile index 58d2812cdcb..81ca19fbffe 100644 --- a/linters/javascript_prettier/Dockerfile +++ b/linters/javascript_prettier/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/javascript_standard/Dockerfile b/linters/javascript_standard/Dockerfile index 995a409e7f9..e085c8894cb 100644 --- a/linters/javascript_standard/Dockerfile +++ b/linters/javascript_standard/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/json_eslint_plugin_jsonc/Dockerfile b/linters/json_eslint_plugin_jsonc/Dockerfile index d6c303d3902..a28b21a2e60 100644 --- a/linters/json_eslint_plugin_jsonc/Dockerfile +++ b/linters/json_eslint_plugin_jsonc/Dockerfile @@ -112,16 +112,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -164,7 +155,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/json_jsonlint/Dockerfile b/linters/json_jsonlint/Dockerfile index 785b2bb4b91..ee5479c65e2 100644 --- a/linters/json_jsonlint/Dockerfile +++ b/linters/json_jsonlint/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/json_npm_package_json_lint/Dockerfile b/linters/json_npm_package_json_lint/Dockerfile index 246c27cd008..7d7cf73f7dc 100644 --- a/linters/json_npm_package_json_lint/Dockerfile +++ b/linters/json_npm_package_json_lint/Dockerfile @@ -111,16 +111,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -163,7 +154,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/json_prettier/Dockerfile b/linters/json_prettier/Dockerfile index 38029aa14a5..285acc2fd5e 100644 --- a/linters/json_prettier/Dockerfile +++ b/linters/json_prettier/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/json_v8r/Dockerfile b/linters/json_v8r/Dockerfile index b60d8496368..f98c4fd6ddb 100644 --- a/linters/json_v8r/Dockerfile +++ b/linters/json_v8r/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/jsx_eslint/Dockerfile b/linters/jsx_eslint/Dockerfile index d9c3298043f..d315c53fa71 100644 --- a/linters/jsx_eslint/Dockerfile +++ b/linters/jsx_eslint/Dockerfile @@ -113,16 +113,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -165,7 +156,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/kotlin_detekt/Dockerfile b/linters/kotlin_detekt/Dockerfile index a9aea892363..ac251c3ec31 100644 --- a/linters/kotlin_detekt/Dockerfile +++ b/linters/kotlin_detekt/Dockerfile @@ -153,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/kotlin_ktlint/Dockerfile b/linters/kotlin_ktlint/Dockerfile index e80a9abb076..63ea2c7fbbc 100644 --- a/linters/kotlin_ktlint/Dockerfile +++ b/linters/kotlin_ktlint/Dockerfile @@ -150,7 +150,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/kubernetes_helm/Dockerfile b/linters/kubernetes_helm/Dockerfile index 63ebde7dab4..0fb89df69f4 100644 --- a/linters/kubernetes_helm/Dockerfile +++ b/linters/kubernetes_helm/Dockerfile @@ -141,7 +141,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/kubernetes_kubeconform/Dockerfile b/linters/kubernetes_kubeconform/Dockerfile index 640459cea3c..02a0d2fe431 100644 --- a/linters/kubernetes_kubeconform/Dockerfile +++ b/linters/kubernetes_kubeconform/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/kubernetes_kubescape/Dockerfile b/linters/kubernetes_kubescape/Dockerfile index c771ea0db52..5459cc785af 100644 --- a/linters/kubernetes_kubescape/Dockerfile +++ b/linters/kubernetes_kubescape/Dockerfile @@ -147,7 +147,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/latex_chktex/Dockerfile b/linters/latex_chktex/Dockerfile index c6f5d973615..0b349e2aeed 100644 --- a/linters/latex_chktex/Dockerfile +++ b/linters/latex_chktex/Dockerfile @@ -143,7 +143,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/lua_luacheck/Dockerfile b/linters/lua_luacheck/Dockerfile index e3990d39fe1..b7a51c7e8c3 100644 --- a/linters/lua_luacheck/Dockerfile +++ b/linters/lua_luacheck/Dockerfile @@ -157,7 +157,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/makefile_checkmake/Dockerfile b/linters/makefile_checkmake/Dockerfile index 4c0e206a766..0120b86c611 100644 --- a/linters/makefile_checkmake/Dockerfile +++ b/linters/makefile_checkmake/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/markdown_markdown_link_check/Dockerfile b/linters/markdown_markdown_link_check/Dockerfile index 59287e0b61f..c2da8ad37bb 100644 --- a/linters/markdown_markdown_link_check/Dockerfile +++ b/linters/markdown_markdown_link_check/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/markdown_markdown_table_formatter/Dockerfile b/linters/markdown_markdown_table_formatter/Dockerfile index 03e67393260..f4612838d5d 100644 --- a/linters/markdown_markdown_table_formatter/Dockerfile +++ b/linters/markdown_markdown_table_formatter/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/markdown_markdownlint/Dockerfile b/linters/markdown_markdownlint/Dockerfile index 82afb5d2506..b01687de88e 100644 --- a/linters/markdown_markdownlint/Dockerfile +++ b/linters/markdown_markdownlint/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/markdown_remark_lint/Dockerfile b/linters/markdown_remark_lint/Dockerfile index 989715935e6..c9c04ff4d55 100644 --- a/linters/markdown_remark_lint/Dockerfile +++ b/linters/markdown_remark_lint/Dockerfile @@ -111,16 +111,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -163,7 +154,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/openapi_spectral/Dockerfile b/linters/openapi_spectral/Dockerfile index dceaf2e4780..ed1dedb5f98 100644 --- a/linters/openapi_spectral/Dockerfile +++ b/linters/openapi_spectral/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/perl_perlcritic/Dockerfile b/linters/perl_perlcritic/Dockerfile index a458239594e..034a6abe065 100644 --- a/linters/perl_perlcritic/Dockerfile +++ b/linters/perl_perlcritic/Dockerfile @@ -146,7 +146,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/php_phpcs/Dockerfile b/linters/php_phpcs/Dockerfile index 0ce14faa2ee..9cadd5c43d0 100644 --- a/linters/php_phpcs/Dockerfile +++ b/linters/php_phpcs/Dockerfile @@ -176,7 +176,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/php_phplint/Dockerfile b/linters/php_phplint/Dockerfile index 7fab641d414..3419cbd0b65 100644 --- a/linters/php_phplint/Dockerfile +++ b/linters/php_phplint/Dockerfile @@ -176,7 +176,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/php_phpstan/Dockerfile b/linters/php_phpstan/Dockerfile index 653888b9abc..8373d6a94fc 100644 --- a/linters/php_phpstan/Dockerfile +++ b/linters/php_phpstan/Dockerfile @@ -175,7 +175,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/php_psalm/Dockerfile b/linters/php_psalm/Dockerfile index 8e8eca52eed..224cd2b6fc7 100644 --- a/linters/php_psalm/Dockerfile +++ b/linters/php_psalm/Dockerfile @@ -176,7 +176,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/powershell_powershell/Dockerfile b/linters/powershell_powershell/Dockerfile index 02a03b3bf7b..9854dc018c6 100644 --- a/linters/powershell_powershell/Dockerfile +++ b/linters/powershell_powershell/Dockerfile @@ -150,7 +150,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/powershell_powershell_formatter/Dockerfile b/linters/powershell_powershell_formatter/Dockerfile index d9a4803b2b9..6cb7344e567 100644 --- a/linters/powershell_powershell_formatter/Dockerfile +++ b/linters/powershell_powershell_formatter/Dockerfile @@ -150,7 +150,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/protobuf_protolint/Dockerfile b/linters/protobuf_protolint/Dockerfile index 08f6a876c2b..4d07173fedc 100644 --- a/linters/protobuf_protolint/Dockerfile +++ b/linters/protobuf_protolint/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/puppet_puppet_lint/Dockerfile b/linters/puppet_puppet_lint/Dockerfile index da9634f9151..0dfa3474b78 100644 --- a/linters/puppet_puppet_lint/Dockerfile +++ b/linters/puppet_puppet_lint/Dockerfile @@ -146,7 +146,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/python_bandit/Dockerfile b/linters/python_bandit/Dockerfile index f14eaa77cb8..ad0e9a88687 100644 --- a/linters/python_bandit/Dockerfile +++ b/linters/python_bandit/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/bandit" && cd "/venvs/bandit" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir bandit bandit_sarif_formatter bandit[toml] && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/bandit/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/python_black/Dockerfile b/linters/python_black/Dockerfile index 88d09417876..ab042dd7f1d 100644 --- a/linters/python_black/Dockerfile +++ b/linters/python_black/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/black" && cd "/venvs/black" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir black && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/black/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/python_flake8/Dockerfile b/linters/python_flake8/Dockerfile index c499a8f3038..5f9267d2aaf 100644 --- a/linters/python_flake8/Dockerfile +++ b/linters/python_flake8/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/flake8" && cd "/venvs/flake8" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir flake8 && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/flake8/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/python_isort/Dockerfile b/linters/python_isort/Dockerfile index d71ffa7c3bf..629b3b5b31f 100644 --- a/linters/python_isort/Dockerfile +++ b/linters/python_isort/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/isort" && cd "/venvs/isort" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir isort black && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/isort/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/python_mypy/Dockerfile b/linters/python_mypy/Dockerfile index 1e3404f803b..62257cf03bc 100644 --- a/linters/python_mypy/Dockerfile +++ b/linters/python_mypy/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/mypy" && cd "/venvs/mypy" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir mypy && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/mypy/bin #PIPVENV__END @@ -146,7 +146,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/python_pylint/Dockerfile b/linters/python_pylint/Dockerfile index 8f5de77c63e..a5d0d9432e6 100644 --- a/linters/python_pylint/Dockerfile +++ b/linters/python_pylint/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/pylint" && cd "/venvs/pylint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir pylint typing-extensions && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/pylint/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/python_pyright/Dockerfile b/linters/python_pyright/Dockerfile index 22a6e0445ad..cf59cf61a9c 100644 --- a/linters/python_pyright/Dockerfile +++ b/linters/python_pyright/Dockerfile @@ -90,7 +90,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/pyright" && cd "/venvs/pyright" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir pyright && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/pyright/bin #PIPVENV__END @@ -145,7 +145,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/python_ruff/Dockerfile b/linters/python_ruff/Dockerfile index 63598dd7cc0..c9a32883496 100644 --- a/linters/python_ruff/Dockerfile +++ b/linters/python_ruff/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/ruff" && cd "/venvs/ruff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir ruff && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/ruff/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/r_lintr/Dockerfile b/linters/r_lintr/Dockerfile index 9854e33e3f0..4c394f38bea 100644 --- a/linters/r_lintr/Dockerfile +++ b/linters/r_lintr/Dockerfile @@ -156,7 +156,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/raku_raku/Dockerfile b/linters/raku_raku/Dockerfile index 98ae28876b1..a214e3fb8f1 100644 --- a/linters/raku_raku/Dockerfile +++ b/linters/raku_raku/Dockerfile @@ -149,7 +149,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/repository_checkov/Dockerfile b/linters/repository_checkov/Dockerfile index 7df3faaf0f6..a61b58c257e 100644 --- a/linters/repository_checkov/Dockerfile +++ b/linters/repository_checkov/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/checkov" && cd "/venvs/checkov" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir packaging checkov && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/checkov/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/repository_devskim/Dockerfile b/linters/repository_devskim/Dockerfile index 5afd297a252..bf05d7d5834 100644 --- a/linters/repository_devskim/Dockerfile +++ b/linters/repository_devskim/Dockerfile @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/repository_dustilock/Dockerfile b/linters/repository_dustilock/Dockerfile index 73371e359b9..85f1062158b 100644 --- a/linters/repository_dustilock/Dockerfile +++ b/linters/repository_dustilock/Dockerfile @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/repository_git_diff/Dockerfile b/linters/repository_git_diff/Dockerfile index 311b7478d68..607d99dfb67 100644 --- a/linters/repository_git_diff/Dockerfile +++ b/linters/repository_git_diff/Dockerfile @@ -140,7 +140,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/repository_gitleaks/Dockerfile b/linters/repository_gitleaks/Dockerfile index d9a0e50a2be..8869c1dd478 100644 --- a/linters/repository_gitleaks/Dockerfile +++ b/linters/repository_gitleaks/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/repository_grype/Dockerfile b/linters/repository_grype/Dockerfile index d97bc2cbce4..674dd22373e 100644 --- a/linters/repository_grype/Dockerfile +++ b/linters/repository_grype/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/repository_kics/Dockerfile b/linters/repository_kics/Dockerfile index acdb49b4d37..60a3332fc08 100644 --- a/linters/repository_kics/Dockerfile +++ b/linters/repository_kics/Dockerfile @@ -145,7 +145,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/repository_secretlint/Dockerfile b/linters/repository_secretlint/Dockerfile index 17630bb8388..1f28d562d32 100644 --- a/linters/repository_secretlint/Dockerfile +++ b/linters/repository_secretlint/Dockerfile @@ -112,16 +112,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -164,7 +155,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/repository_semgrep/Dockerfile b/linters/repository_semgrep/Dockerfile index 72fd829e59f..fe9c3a191b5 100644 --- a/linters/repository_semgrep/Dockerfile +++ b/linters/repository_semgrep/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/semgrep" && cd "/venvs/semgrep" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir semgrep && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/semgrep/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/repository_syft/Dockerfile b/linters/repository_syft/Dockerfile index ff3dbf5a820..1b31c2d9f6f 100644 --- a/linters/repository_syft/Dockerfile +++ b/linters/repository_syft/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/repository_trivy/Dockerfile b/linters/repository_trivy/Dockerfile index 9a7250edc3c..1720ad13333 100644 --- a/linters/repository_trivy/Dockerfile +++ b/linters/repository_trivy/Dockerfile @@ -143,7 +143,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/repository_trivy_sbom/Dockerfile b/linters/repository_trivy_sbom/Dockerfile index e389786c497..516d775eef8 100644 --- a/linters/repository_trivy_sbom/Dockerfile +++ b/linters/repository_trivy_sbom/Dockerfile @@ -143,7 +143,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/repository_trufflehog/Dockerfile b/linters/repository_trufflehog/Dockerfile index 9642b05af9d..5ff3f3ecc7f 100644 --- a/linters/repository_trufflehog/Dockerfile +++ b/linters/repository_trufflehog/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/rst_rst_lint/Dockerfile b/linters/rst_rst_lint/Dockerfile index 1678c8863d9..d09a8b7df20 100644 --- a/linters/rst_rst_lint/Dockerfile +++ b/linters/rst_rst_lint/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/rst-lint" && cd "/venvs/rst-lint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir restructuredtext_lint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/rst-lint/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/rst_rstcheck/Dockerfile b/linters/rst_rstcheck/Dockerfile index 78d735539c5..0c1b976dedd 100644 --- a/linters/rst_rstcheck/Dockerfile +++ b/linters/rst_rstcheck/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/rstcheck" && cd "/venvs/rstcheck" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir rstcheck[toml,sphinx] && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/rstcheck/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/rst_rstfmt/Dockerfile b/linters/rst_rstfmt/Dockerfile index df3f0ed43bc..007ea451e0c 100644 --- a/linters/rst_rstfmt/Dockerfile +++ b/linters/rst_rstfmt/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/rstfmt" && cd "/venvs/rstfmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir rstfmt && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/rstfmt/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/ruby_rubocop/Dockerfile b/linters/ruby_rubocop/Dockerfile index bd07082a944..2ab66d16562 100644 --- a/linters/ruby_rubocop/Dockerfile +++ b/linters/ruby_rubocop/Dockerfile @@ -151,7 +151,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/rust_clippy/Dockerfile b/linters/rust_clippy/Dockerfile index 02f068f331a..1aba5fc5942 100644 --- a/linters/rust_clippy/Dockerfile +++ b/linters/rust_clippy/Dockerfile @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/salesforce_lightning_flow_scanner/Dockerfile b/linters/salesforce_lightning_flow_scanner/Dockerfile index 2cc14df36cc..66e6acb01c7 100644 --- a/linters/salesforce_lightning_flow_scanner/Dockerfile +++ b/linters/salesforce_lightning_flow_scanner/Dockerfile @@ -111,16 +111,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -176,7 +167,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/salesforce_sfdx_scanner_apex/Dockerfile b/linters/salesforce_sfdx_scanner_apex/Dockerfile index 1cfc4db1be3..7a3be4afb62 100644 --- a/linters/salesforce_sfdx_scanner_apex/Dockerfile +++ b/linters/salesforce_sfdx_scanner_apex/Dockerfile @@ -111,16 +111,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -176,7 +167,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/salesforce_sfdx_scanner_aura/Dockerfile b/linters/salesforce_sfdx_scanner_aura/Dockerfile index 3f1791df1ee..848baf6256e 100644 --- a/linters/salesforce_sfdx_scanner_aura/Dockerfile +++ b/linters/salesforce_sfdx_scanner_aura/Dockerfile @@ -111,16 +111,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -176,7 +167,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/salesforce_sfdx_scanner_lwc/Dockerfile b/linters/salesforce_sfdx_scanner_lwc/Dockerfile index add81c0afdf..d45710898aa 100644 --- a/linters/salesforce_sfdx_scanner_lwc/Dockerfile +++ b/linters/salesforce_sfdx_scanner_lwc/Dockerfile @@ -111,16 +111,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -176,7 +167,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/scala_scalafix/Dockerfile b/linters/scala_scalafix/Dockerfile index a3bc99b8dce..690b490f34c 100644 --- a/linters/scala_scalafix/Dockerfile +++ b/linters/scala_scalafix/Dockerfile @@ -149,7 +149,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/snakemake_lint/Dockerfile b/linters/snakemake_lint/Dockerfile index 891e2ac47b2..5f75fe0b12a 100644 --- a/linters/snakemake_lint/Dockerfile +++ b/linters/snakemake_lint/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/snakemake" && cd "/venvs/snakemake" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakemake && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/snakemake/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/snakemake_snakefmt/Dockerfile b/linters/snakemake_snakefmt/Dockerfile index 8411b854f83..3453a91a908 100644 --- a/linters/snakemake_snakefmt/Dockerfile +++ b/linters/snakemake_snakefmt/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/snakefmt" && cd "/venvs/snakefmt" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir snakefmt && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/snakefmt/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/spell_cspell/Dockerfile b/linters/spell_cspell/Dockerfile index f729f2806b5..7b93bbde700 100644 --- a/linters/spell_cspell/Dockerfile +++ b/linters/spell_cspell/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/spell_lychee/Dockerfile b/linters/spell_lychee/Dockerfile index 7aed42f9c26..601116b89e2 100644 --- a/linters/spell_lychee/Dockerfile +++ b/linters/spell_lychee/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/spell_proselint/Dockerfile b/linters/spell_proselint/Dockerfile index 8affa612ed2..874b63f5bde 100644 --- a/linters/spell_proselint/Dockerfile +++ b/linters/spell_proselint/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/proselint" && cd "/venvs/proselint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir proselint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/proselint/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/spell_vale/Dockerfile b/linters/spell_vale/Dockerfile index a2af6269a6e..4beb04b8c01 100644 --- a/linters/spell_vale/Dockerfile +++ b/linters/spell_vale/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/sql_sql_lint/Dockerfile b/linters/sql_sql_lint/Dockerfile index 5df7eaa88d7..a68ea775f61 100644 --- a/linters/sql_sql_lint/Dockerfile +++ b/linters/sql_sql_lint/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/sql_sqlfluff/Dockerfile b/linters/sql_sqlfluff/Dockerfile index b0eebf6bb6f..a851eaba903 100644 --- a/linters/sql_sqlfluff/Dockerfile +++ b/linters/sql_sqlfluff/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/sqlfluff" && cd "/venvs/sqlfluff" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir sqlfluff && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/sqlfluff/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/sql_tsqllint/Dockerfile b/linters/sql_tsqllint/Dockerfile index 4e5a26e2cb1..46ed6187917 100644 --- a/linters/sql_tsqllint/Dockerfile +++ b/linters/sql_tsqllint/Dockerfile @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/swift_swiftlint/Dockerfile b/linters/swift_swiftlint/Dockerfile index 93d03886241..8fe56cdfcd3 100644 --- a/linters/swift_swiftlint/Dockerfile +++ b/linters/swift_swiftlint/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/tekton_tekton_lint/Dockerfile b/linters/tekton_tekton_lint/Dockerfile index c11367762d6..7d519df67fe 100644 --- a/linters/tekton_tekton_lint/Dockerfile +++ b/linters/tekton_tekton_lint/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/terraform_terraform_fmt/Dockerfile b/linters/terraform_terraform_fmt/Dockerfile index a39084d5a5a..3c1b2d4d000 100644 --- a/linters/terraform_terraform_fmt/Dockerfile +++ b/linters/terraform_terraform_fmt/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/terraform_terragrunt/Dockerfile b/linters/terraform_terragrunt/Dockerfile index c4ae30d7792..35fa03d4c05 100644 --- a/linters/terraform_terragrunt/Dockerfile +++ b/linters/terraform_terragrunt/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/terraform_terrascan/Dockerfile b/linters/terraform_terrascan/Dockerfile index d4896460896..7fbdbb9ddbd 100644 --- a/linters/terraform_terrascan/Dockerfile +++ b/linters/terraform_terrascan/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/terraform_tflint/Dockerfile b/linters/terraform_tflint/Dockerfile index e01584d64e3..231d4c14f01 100644 --- a/linters/terraform_tflint/Dockerfile +++ b/linters/terraform_tflint/Dockerfile @@ -142,7 +142,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/tsx_eslint/Dockerfile b/linters/tsx_eslint/Dockerfile index 7005dcbf9ab..a4ba30afcc7 100644 --- a/linters/tsx_eslint/Dockerfile +++ b/linters/tsx_eslint/Dockerfile @@ -122,16 +122,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -174,7 +165,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/typescript_es/Dockerfile b/linters/typescript_es/Dockerfile index 95c773494d8..fbc2e1c65e9 100644 --- a/linters/typescript_es/Dockerfile +++ b/linters/typescript_es/Dockerfile @@ -125,16 +125,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -177,7 +168,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/typescript_prettier/Dockerfile b/linters/typescript_prettier/Dockerfile index c0c5a68b67a..67c65bdecb9 100644 --- a/linters/typescript_prettier/Dockerfile +++ b/linters/typescript_prettier/Dockerfile @@ -111,16 +111,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -163,7 +154,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/typescript_standard/Dockerfile b/linters/typescript_standard/Dockerfile index da7eee5062c..adb6648597e 100644 --- a/linters/typescript_standard/Dockerfile +++ b/linters/typescript_standard/Dockerfile @@ -111,16 +111,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -163,7 +154,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/vbdotnet_dotnet_format/Dockerfile b/linters/vbdotnet_dotnet_format/Dockerfile index 7d31cb5c73d..a1113e694b0 100644 --- a/linters/vbdotnet_dotnet_format/Dockerfile +++ b/linters/vbdotnet_dotnet_format/Dockerfile @@ -143,7 +143,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/xml_xmllint/Dockerfile b/linters/xml_xmllint/Dockerfile index 0e5238690f4..7ad6e5e4a8d 100644 --- a/linters/xml_xmllint/Dockerfile +++ b/linters/xml_xmllint/Dockerfile @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/yaml_prettier/Dockerfile b/linters/yaml_prettier/Dockerfile index d7139bd3321..2f30a910f02 100644 --- a/linters/yaml_prettier/Dockerfile +++ b/linters/yaml_prettier/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/yaml_v8r/Dockerfile b/linters/yaml_v8r/Dockerfile index f7c82ddbfd6..f1cce0b3606 100644 --- a/linters/yaml_v8r/Dockerfile +++ b/linters/yaml_v8r/Dockerfile @@ -110,16 +110,7 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \ && echo "Changing owner of node_modules files…" \ && chown -R "$(id -u)":"$(id -g)" node_modules # fix for https://github.com/npm/cli/issues/5900 \ && echo "Removing extra node_module files…" \ - && rm -rf /root/.npm/_cacache \ - && find . -name "*.d.ts" -delete \ - && find . -name "*.map" -delete \ - && find . -name "*.npmignore" -delete \ - && find . -name "*.travis.yml" -delete \ - && find . -name "CHANGELOG.md" -delete \ - && find . -name "README.md" -delete \ - && find . -name ".package-lock.json" -delete \ - && find . -name "package-lock.json" -delete \ - && find . -name "README.md" -delete + && find . \( -not -path "/proc" \) -and \( -type f \( -iname "*.d.ts" -o -iname "*.map" -o -iname "*.npmignore" -o -iname "*.travis.yml" -o -iname "CHANGELOG.md" -o -iname "README.md" -o -iname ".package-lock.json" -o -iname "package-lock.json" \) -o -type d -name /root/.npm/_cacache \) -delete WORKDIR / #NPM__END @@ -162,7 +153,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/linters/yaml_yamllint/Dockerfile b/linters/yaml_yamllint/Dockerfile index 47fee615854..20bfeba881d 100644 --- a/linters/yaml_yamllint/Dockerfile +++ b/linters/yaml_yamllint/Dockerfile @@ -89,7 +89,7 @@ RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin || true && \ #PIPVENV__START RUN PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir --upgrade pip virtualenv \ && mkdir -p "/venvs/yamllint" && cd "/venvs/yamllint" && virtualenv . && source bin/activate && PYTHONDONTWRITEBYTECODE=1 pip3 install --no-cache-dir yamllint && deactivate && cd ./../.. \ - && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ + && find /venvs \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete \ && rm -rf /root/.cache ENV PATH="${PATH}":/venvs/yamllint/bin #PIPVENV__END @@ -144,7 +144,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete ####################################### # Copy scripts and rules to container # diff --git a/server/Dockerfile b/server/Dockerfile index 234ca761b0d..d776f4d97d4 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -10,7 +10,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete COPY server /server COPY server/requirements.txt requirements.txt diff --git a/server/Dockerfile-dev b/server/Dockerfile-dev index d2a4d8b951b..6dd31b11211 100644 --- a/server/Dockerfile-dev +++ b/server/Dockerfile-dev @@ -26,7 +26,7 @@ COPY megalinter /megalinter RUN PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py install \ && PYTHONDONTWRITEBYTECODE=1 python /megalinter/setup.py clean --all \ && rm -rf /var/cache/apk/* \ - && find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf + && find . \( -type f \( -iname \*.pyc -o -iname \*.pyo \) -o -type d -iname __pycache__ \) -delete COPY megalinter/descriptors /megalinter-descriptors COPY TEMPLATES /action/lib/.automation