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:
parent
84dc45371e
commit
00cae500b0
4 changed files with 3 additions and 89 deletions
32
.github/problem-matcher-gcc.json
vendored
32
.github/problem-matcher-gcc.json
vendored
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
23
.github/problem-matcher-tty.json
vendored
23
.github/problem-matcher-tty.json
vendored
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
18
README.md
18
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
|
||||
...
|
||||
|
|
19
action.yaml
19
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}}
|
||||
|
|
Loading…
Reference in a new issue