Skip to content

Commit

Permalink
Remove non-working problem matchers. (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Jan 29, 2023
1 parent 84dc453 commit 00cae50
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 89 deletions.
32 changes: 0 additions & 32 deletions .github/problem-matcher-gcc.json

This file was deleted.

23 changes: 0 additions & 23 deletions .github/problem-matcher-tty.json

This file was deleted.

18 changes: 2 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
...
Expand Down
19 changes: 1 addition & 18 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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}}

0 comments on commit 00cae50

Please sign in to comment.