diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 5ea552f..473600e 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -79,6 +79,9 @@ on: required: false type: boolean default: true + SUPER_LINTER_FILTER_REGEX_EXCLUDE: + required: false + type: string jobs: flake8: @@ -226,3 +229,4 @@ jobs: VALIDATE_RENOVATE: "${{ inputs.VALIDATE_RENOVATE == true && true || '' }}" VALIDATE_XML: "${{ inputs.VALIDATE_XML == true && true || '' }}" VALIDATE_YAML: "${{ inputs.VALIDATE_YAML == true && true || '' }}" + FILTER_REGEX_EXCLUDE: ${{ inputs.SUPER_LINTER_FILTER_REGEX_EXCLUDE }} diff --git a/README.md b/README.md index 3ff0202..17fbda4 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,26 @@ do not exists, although an additional `ruff.toml` file will be merged. See [linting-config-examples](linting-config-examples/README.md) for more details on how to configure the individual linters. +To exclude files (files, folders or patterns) to be linted with super linter completely +(e.g. to exclude specific files from JSON linting via super-linter) +add them to the `linting.yml` in the repo where the workflow is used, e.g.: + +``` +jobs: + lint: + uses: mundialis/github-workflows/.github/workflows/linting.yml@main + with: + SUPER_LINTER_FILTER_REGEX_EXCLUDE: ".*processing/templates/template_MAIN_loop.json" +``` + +Attention: This skips the whole file to be linted with super-linter! + -> all-or-nothing per file +To exlude python files, use the dedicated exclude configs (e.g. `.flake8`). + +Always prefer to exlude more specific rules instead of a whole file +as explained in the [linting-config-example](https://github.com/mundialis/github-workflows/tree/main/linting-config-examples#superlinter) + + ### (Python) Linting - reviewdog For `ruff` and `black` linting, another workflow can propose suggestions to a pull request.