1
0
Fork 0
mirror of https://github.com/ludeeus/action-shellcheck.git synced 2024-08-16 10:09:53 +02:00

Remove non-working problem matchers. (#88)

This commit is contained in:
Joakim Sørensen 2023-01-29 17:39:54 +01:00 committed by GitHub
parent 84dc45371e
commit 00cae500b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 89 deletions

View file

@ -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
}
]
}
]
}

View file

@ -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
}
]
}
]
}

View file

@ -140,26 +140,12 @@ If you need to scan for unusual files, you can use the `additional_files` key.
additional_files: 'run finish' 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 ## 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). 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 - `tty` has multi-line log messages
- `gcc` has single-line log messages, so it's easier to parse with a problem matcher (including correct severity annotation) - `gcc` has single-line log messages
```yaml ```yaml
... ...

View file

@ -35,6 +35,7 @@ inputs:
description: "Set to true to skip using problem-matcher" description: "Set to true to skip using problem-matcher"
required: false required: false
default: "false" default: "false"
deprecationMessage: "There are no problem-matchers, this setting does not do anything."
format: format:
description: "Output format (checkstyle, diff, gcc, json, json1, quiet, tty)" description: "Output format (checkstyle, diff, gcc, json, json1, quiet, tty)"
required: false required: false
@ -56,17 +57,6 @@ branding:
runs: runs:
using: "composite" using: "composite"
steps: 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 - name: Download shellcheck
shell: bash shell: bash
env: env:
@ -230,13 +220,6 @@ runs:
set +f # re-enable globbing 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 - name: Exit action
shell: bash shell: bash
run: exit ${{steps.check.outputs.statuscode}} run: exit ${{steps.check.outputs.statuscode}}