Skip to content

Commit

Permalink
Merge pull request #49 from salzmannsusan/master
Browse files Browse the repository at this point in the history
Make the pre-defined 'errorformat' an input variable
  • Loading branch information
haya14busa committed Jun 8, 2024
2 parents 7f0ba20 + 04c9670 commit 99c2cfe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,8 @@ Please note that some command-line arguments can be defined with other fields in

#### `tool_name`

**Optional**. Tool name to use for reviewdog reporter. Defaults to `flake8`.
**Optional**. Tool name to use for reviewdog reporter. Defaults to `flake8`..

#### `error_format`

**Optional**. Pre-defined error format `[flake8, pep8]`. Defaults to `flake8`.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ inputs:
description: "Tool name to use for reviewdog reporter."
required: false
default: "flake8"
error_format:
description: "Pre-defined error format [flake8, pep8]"
required: false
default: "flake8"
level:
description: "Report level for reviewdog [info, warning, error]."
required: false
Expand Down Expand Up @@ -49,6 +53,7 @@ runs:
INPUT_FLAKE8_ARGS: ${{ inputs.flake8_Args }}
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_TOOL_NAME: ${{ inputs.tool_name }}
INPUT_ERROR_FORMAT: ${{ inputs.error_format }}
INPUT_LEVEL: ${{ inputs.level }}
INPUT_REPORTER: ${{ inputs.reporter }}
INPUT_FILTER_MODE: ${{ inputs.filter_mode }}
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ flake8 --version
echo "[action-flake8] Checking python code with the flake8 linter and reviewdog..."
exit_val="0"
flake8 . ${INPUT_FLAKE8_ARGS} 2>&1 | # Removes ansi codes see https://github.com/reviewdog/errorformat/issues/51

Check notice on line 24 in entrypoint.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] entrypoint.sh#L24 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./entrypoint.sh:24:10: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
/tmp/reviewdog -f=flake8 \
/tmp/reviewdog -f="${INPUT_ERROR_FORMAT}" \
-name="${INPUT_TOOL_NAME}" \
-reporter="${INPUT_REPORTER}" \
-filter-mode="${INPUT_FILTER_MODE}" \
Expand Down

0 comments on commit 99c2cfe

Please sign in to comment.