From 00cae500b08a931fb5698e11e79bfbd38e612a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Sun, 29 Jan 2023 17:39:54 +0100 Subject: [PATCH] Remove non-working problem matchers. (#88) --- .github/problem-matcher-gcc.json | 32 -------------------------------- .github/problem-matcher-tty.json | 23 ----------------------- README.md | 18 ++---------------- action.yaml | 19 +------------------ 4 files changed, 3 insertions(+), 89 deletions(-) delete mode 100644 .github/problem-matcher-gcc.json delete mode 100644 .github/problem-matcher-tty.json diff --git a/.github/problem-matcher-gcc.json b/.github/problem-matcher-gcc.json deleted file mode 100644 index 09b4070..0000000 --- a/.github/problem-matcher-gcc.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "shellcheck-gcc", - "pattern": [ - { - "regexp": "^\\.?\\/?(.+):(\\d+):(\\d+):\\s(warning|error):\\s(.*)\\s\\[(SC\\d+)\\]$", - "file": 1, - "line": 2, - "column": 3, - "severity": 4, - "message": 5, - "code": 6 - } - ] - }, - { - "owner": "shellcheck-gcc-notice", - "severity": "notice", - "pattern": [ - { - "regexp": "^\\.?\\/?(.+):(\\d+):(\\d+):\\s(note):\\s(.*)\\s\\[(SC\\d+)\\]$", - "file": 1, - "line": 2, - "column": 3, - "message": 5, - "code": 6 - } - ] - } - ] -} diff --git a/.github/problem-matcher-tty.json b/.github/problem-matcher-tty.json deleted file mode 100644 index 2467ff8..0000000 --- a/.github/problem-matcher-tty.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "shellcheck-tty", - "pattern": [ - { - "regexp": "^In\\s\\.?\\/?(.+)\\sline\\s(\\d+):$", - "file": 1, - "line": 2 - }, - { - "regexp": ".*" - }, - { - "regexp": "(SC\\d+):\\s(.+)$", - "code": 1, - "message": 2, - "loop": true - } - ] - } - ] - } diff --git a/README.md b/README.md index 12ed491..782d8ef 100644 --- a/README.md +++ b/README.md @@ -140,26 +140,12 @@ If you need to scan for unusual files, you can use the `additional_files` key. additional_files: 'run finish' ``` -## Disable problem matcher - -If you do not want to have the problem-matcher annotate files, you can disable it -by setting `disable_matcher` to `true`. - -```yaml - ... - - name: Run ShellCheck - uses: ludeeus/action-shellcheck@master - with: - disable_matcher: true -``` - ## Change output format Shellcheck can print output in these formats: `checkstyle`, `diff`, `gcc`, `json`, `json1`, `quiet`, `tty`. See some examples [here](https://github.com/koalaman/shellcheck/wiki/Integration#pick-the-output-format-that-makes-your-life-easier). -Only `tty` and `gcc` produce file annotations via problem matcher, default is `gcc`. -- `tty` has multi-line log messages, but all annotations are reported as errors -- `gcc` has single-line log messages, so it's easier to parse with a problem matcher (including correct severity annotation) +- `tty` has multi-line log messages +- `gcc` has single-line log messages ```yaml ... diff --git a/action.yaml b/action.yaml index 2aa622d..130781e 100644 --- a/action.yaml +++ b/action.yaml @@ -35,6 +35,7 @@ inputs: description: "Set to true to skip using problem-matcher" required: false default: "false" + deprecationMessage: "There are no problem-matchers, this setting does not do anything." format: description: "Output format (checkstyle, diff, gcc, json, json1, quiet, tty)" required: false @@ -56,17 +57,6 @@ branding: runs: using: "composite" steps: - - name: Enable problem-matcher - shell: bash - env: - INPUT_FORMAT: ${{ inputs.format }} - INPUT_DISABLE_MATCHER: ${{ inputs.disable_matcher }} - run: | - problem_matcher_file="${{ github.action_path }}/.github/problem-matcher-${INPUT_FORMAT}.json" - if [[ "${INPUT_DISABLE_MATCHER}" != "true" && -f "$problem_matcher_file" ]]; then - echo "::add-matcher::$problem_matcher_file" - fi - - name: Download shellcheck shell: bash env: @@ -230,13 +220,6 @@ runs: set +f # re-enable globbing - - name: Remove problem-matcher - shell: bash - run: | - echo "::remove-matcher owner=shellcheck-gcc::" - echo "::remove-matcher owner=shellcheck-gcc-notice::" - echo "::remove-matcher owner=shellcheck-tty::" - - name: Exit action shell: bash run: exit ${{steps.check.outputs.statuscode}}