Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the pre-defined 'errorformat' an input variable #49

Merged
merged 4 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
/tmp/reviewdog -f=flake8 \
/tmp/reviewdog -f="${INPUT_ERROR_FORMAT}" \
-name="${INPUT_TOOL_NAME}" \
-reporter="${INPUT_REPORTER}" \
-filter-mode="${INPUT_FILTER_MODE}" \
Expand Down