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

Feature: Support reviewdog filter mode #15

Merged
merged 1 commit into from
Mar 25, 2021
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ The default is `github-pr-check`.
Optional. Fails the current check if any error was found [`true`/`false`]
The default value is false.

### `filter_mode`
Optional. Filter mode of reviewdog command [`added`,`diff_context`,`file`,`nofilter`]
Default is `added`.

### `relative`

Optional. Print files relative to the working directory [`true`/`false`]
Expand Down
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ inputs:
Default is false.
required: false
default: 'false'
filter_mode:
description: |
Filter mode of reviewdog command [added,diff_context,file,nofilter]
Default is added.
required: false
default: 'added'
relative:
description: Print files relative to the working directory
required: false
Expand All @@ -38,6 +44,7 @@ runs:
- ${{ inputs.level }}
- ${{ inputs.reporter }}
- ${{ inputs.fail_on_error }}
- ${{ inputs.filter_mode }}
- ${{ inputs.relative }}
- ${{ inputs.android }}
branding:
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"

echo KtLint version: "$(ktlint --version)"
ktlint --reporter=checkstyle $RELATIVE $ANDROID \
| reviewdog -f=checkstyle -name="ktlint" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}"
| reviewdog -f=checkstyle -name="ktlint" -reporter="${INPUT_REPORTER}" -filter-mode="${INPUT_FILTER_MODE}" -level="${INPUT_LEVEL}"