From e11786a54c67c5ae67da6a5be3011f6c604f0154 Mon Sep 17 00:00:00 2001 From: Lukas Gravley Date: Tue, 19 Jan 2021 11:03:14 -0600 Subject: [PATCH] Adding Flag for Possum (#1149) * adding a bad feature * fix hadolint --- .../reports/expected-DOCKERFILE_HADOLINT.tap | 2 +- README.md | 1 + lib/linter.sh | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.automation/test/dockerfile_hadolint/reports/expected-DOCKERFILE_HADOLINT.tap b/.automation/test/dockerfile_hadolint/reports/expected-DOCKERFILE_HADOLINT.tap index 3608af9f..21e0f059 100644 --- a/.automation/test/dockerfile_hadolint/reports/expected-DOCKERFILE_HADOLINT.tap +++ b/.automation/test/dockerfile_hadolint/reports/expected-DOCKERFILE_HADOLINT.tap @@ -2,7 +2,7 @@ TAP version 13 1..3 not ok 1 - Dockerfile --- - message: /tmp/lint/.automation/test/dockerfile_hadolint/bad/Dockerfile 1 DL3007 Using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag\n/tmp/lint/.automation/test/dockerfile_hadolint/bad/Dockerfile 8 DL3021 COPY with more than 2 arguments requires the last argument to end with /\n/tmp/lint/.automation/test/dockerfile_hadolint/bad/Dockerfile 9 DL3004 Do not use sudo as it leads to unpredictable behavior. Use a tool like gosu to enforce root\n/tmp/lint/.automation/test/dockerfile_hadolint/bad/Dockerfile 11 DL3020 Use COPY instead of ADD for files and folders\n/tmp/lint/.automation/test/dockerfile_hadolint/bad/Dockerfile 14 DL3025 Use arguments JSON notation for CMD and ENTRYPOINT arguments\n + message: /tmp/lint/.automation/test/dockerfile_hadolint/bad/Dockerfile 1 DL3007 warning Using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag\n/tmp/lint/.automation/test/dockerfile_hadolint/bad/Dockerfile 8 DL3021 error COPY with more than 2 arguments requires the last argument to end with /\n/tmp/lint/.automation/test/dockerfile_hadolint/bad/Dockerfile 9 DL3004 error Do not use sudo as it leads to unpredictable behavior. Use a tool like gosu to enforce root\n/tmp/lint/.automation/test/dockerfile_hadolint/bad/Dockerfile 11 DL3020 error Use COPY instead of ADD for files and folders\n/tmp/lint/.automation/test/dockerfile_hadolint/bad/Dockerfile 14 DL3025 warning Use arguments JSON notation for CMD and ENTRYPOINT arguments\n ... ok 2 - Dockerfile ok 3 - Dockerfile.dev diff --git a/README.md b/README.md index 501c0f8b..acb24746 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,7 @@ But if you wish to select or exclude specific linters, we give you full control | **PYTHON_ISORT_CONFIG_FILE** | `.isort.cfg` | Filename for [isort configuration](https://pycqa.github.io/isort/docs/configuration/config_files/) (ex: `.isort.cfg`, `pyproject.toml`) | | **PYTHON_PYLINT_CONFIG_FILE** | `.python-lint` | Filename for [pylint configuration](https://pylint.pycqa.org/en/latest/user_guide/run.html?highlight=rcfile#command-line-options) (ex: `.python-lint`, `.pylintrc`) | | **RUBY_CONFIG_FILE** | `.ruby-lint.yml` | Filename for [rubocop configuration](https://docs.rubocop.org/rubocop/configuration.html) (ex: `.ruby-lint.yml`, `.rubocop.yml`) | +| **SUPPRESS_POSSUM** | `false` | If set to `true`, will hide the ASCII possum at top of log output. Default is `false` | **SNAKEMAKE_SNAKEFMT_CONFIG_FILE** | `.snakefmt.toml` | Filename for [Snakemake configuration](https://github.com/snakemake/snakefmt#configuration) (ex: `pyproject.toml`, `.snakefmt.toml`) | | **TYPESCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [eslint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`) | | **VALIDATE_ALL_CODEBASE** | `true` | Will parse the entire repository and find all files to validate across all types. **NOTE:** When set to `false`, only **new** or **edited** files will be parsed for validation. | diff --git a/lib/linter.sh b/lib/linter.sh index 1c8f83bc..03698848 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -143,6 +143,8 @@ RUBY_FILE_NAME="${RUBY_CONFIG_FILE:-.ruby-lint.yml}" # shellcheck disable=SC2034 # Variable is referenced indirectly SNAKEMAKE_SNAKEFMT_FILE_NAME="${SNAKEMAKE_SNAKEFMT_CONFIG_FILE:-.snakefmt.toml}" # shellcheck disable=SC2034 # Variable is referenced indirectly +SUPPRESS_POSSUM="${SUPPRESS_POSSUM:-false}" +# shellcheck disable=SC2034 # Variable is referenced indirectly SQL_FILE_NAME=".sql-config.json" # shellcheck disable=SC2034 # Variable is referenced indirectly TERRAFORM_FILE_NAME=".tflint.hcl" @@ -329,7 +331,9 @@ Header() { ############################### # Give them the possum action # ############################### - /bin/bash /action/lib/functions/possum.sh + if [[ "${SUPPRESS_POSSUM}" == "false" ]]; then + /bin/bash /action/lib/functions/possum.sh + fi ########## # Prints #