Skip to content

Commit

Permalink
Order inputs alphabetically (#102)
Browse files Browse the repository at this point in the history
* order inputs alphabetically

* add a comment requesting to keep alphabetical order

* Better wording in comments requesting to maintain alphabetical order of inputs

Co-authored-by: Javier Julio <javierjulio@icloud.com>

---------

Co-authored-by: Javier Julio <javierjulio@icloud.com>
  • Loading branch information
toy and javierjulio committed May 15, 2024
1 parent 8d644c0 commit 6c175bc
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 64 deletions.
68 changes: 35 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,35 @@ With `reporter: github-pr-review` a comment is added to the Pull Request Convers

## Inputs

<!-- Please maintain inputs in alphabetical order -->

### `fail_on_error`

Optional. Exit code for reviewdog when errors are found [`true`, `false`].
Default is `false`.

### `filter_mode`

Optional. Filtering mode for the reviewdog command [`added`, `diff_context`, `file`, `nofilter`].
Default is `added`.

### `github_token`

`GITHUB_TOKEN`. Default is `${{ github.token }}`.

### `rubocop_version`
### `level`

Optional. Set rubocop version. Possible values:
Optional. Report level for reviewdog [`info`, `warning`, `error`].
It's same as `-level` flag of reviewdog.

- empty or omit: install latest version
- `gemfile`: install version from Gemfile (`Gemfile.lock` should be presented, otherwise it will fallback to latest bundler version)
- version (e.g. `0.90.0`): install said version
### `reporter`

Optional. Reporter of reviewdog command [`github-pr-check`, `github-check`, `github-pr-review`].
The default is `github-pr-check`.

### `reviewdog_flags`

Optional. Additional reviewdog flags.

### `rubocop_extensions`

Expand All @@ -57,47 +75,31 @@ You can combine `gemfile`, fixed and latest bundle version as you want to.

Optional. Rubocop flags. (rubocop `<rubocop_flags>`).

### `tool_name`

Optional. Tool name to use for reviewdog reporter. Useful when running multiple
actions with different config.

### `level`

Optional. Report level for reviewdog [`info`, `warning`, `error`].
It's same as `-level` flag of reviewdog.
### `rubocop_version`

### `reporter`
Optional. Set rubocop version. Possible values:

Optional. Reporter of reviewdog command [`github-pr-check`, `github-check`, `github-pr-review`].
The default is `github-pr-check`.
- empty or omit: install latest version
- `gemfile`: install version from Gemfile (`Gemfile.lock` should be presented, otherwise it will fallback to latest bundler version)
- version (e.g. `0.90.0`): install said version

### `filter_mode`
### `skip_install`

Optional. Filtering mode for the reviewdog command [`added`, `diff_context`, `file`, `nofilter`].
Default is `added`.
Optional. Do not install Rubocop or its extensions. Default: `false`.

### `fail_on_error`
### `tool_name`

Optional. Exit code for reviewdog when errors are found [`true`, `false`].
Default is `false`.
Optional. Tool name to use for reviewdog reporter. Useful when running multiple
actions with different config.

### `reviewdog_flags`
### `use_bundler`

Optional. Additional reviewdog flags.
Optional. Run Rubocop with bundle exec. Default: `false`.

### `workdir`

Optional. The directory from which to look for and run Rubocop. Default `.`.

### `skip_install`

Optional. Do not install Rubocop or its extensions. Default: `false`.

### `use_bundler`

Optional. Run Rubocop with bundle exec. Default: `false`.

## Example usage

This action will use your [RuboCop Configuration](https://docs.rubocop.org/rubocop/configuration.html) automatically.
Expand Down
64 changes: 33 additions & 31 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ name: 'Run rubocop with reviewdog'
description: '🐶 Run rubocop with reviewdog on pull requests to improve code review experience.'
author: 'mgrachev (reviewdog)'
inputs:
# Please maintain inputs in alphabetical order
fail_on_error:
description: |
Exit code for reviewdog when errors are found [true,false]
Default is `false`.
default: 'false'
filter_mode:
description: |
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
Default is added.
default: 'added'
github_token:
description: 'GITHUB_TOKEN'
default: ${{ github.token }}
rubocop_version:
description: 'Rubocop version'
rubocop_extensions:
description: 'Rubocop extensions'
default: 'rubocop-rails rubocop-performance rubocop-rspec rubocop-i18n rubocop-rake'
rubocop_flags:
description: 'Rubocop flags. (rubocop <rubocop_flags>)'
default: ''
tool_name:
description: 'Tool name to use for reviewdog reporter'
default: 'rubocop'
level:
description: 'Report level for reviewdog [info,warning,error]'
default: 'error'
Expand All @@ -24,28 +24,29 @@ inputs:
Reporter of reviewdog command [github-pr-check,github-check,github-pr-review].
Default is github-pr-check.
default: 'github-pr-check'
filter_mode:
description: |
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
Default is added.
default: 'added'
fail_on_error:
description: |
Exit code for reviewdog when errors are found [true,false]
Default is `false`.
default: 'false'
reviewdog_flags:
description: 'Additional reviewdog flags'
default: ''
workdir:
description: "The directory from which to look for and run Rubocop. Default '.'"
default: '.'
rubocop_extensions:
description: 'Rubocop extensions'
default: 'rubocop-rails rubocop-performance rubocop-rspec rubocop-i18n rubocop-rake'
rubocop_flags:
description: 'Rubocop flags. (rubocop <rubocop_flags>)'
default: ''
rubocop_version:
description: 'Rubocop version'
skip_install:
description: "Do not install Rubocop or its extensions. Default: `false`"
default: 'false'
tool_name:
description: 'Tool name to use for reviewdog reporter'
default: 'rubocop'
use_bundler:
description: "Run Rubocop with bundle exec. Default: `false`"
default: 'false'
workdir:
description: "The directory from which to look for and run Rubocop. Default '.'"
default: '.'
runs:
using: 'composite'
steps:
Expand All @@ -55,19 +56,20 @@ runs:
REVIEWDOG_VERSION: v0.17.4
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
# Please maintain inputs in alphabetical order
INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }}
INPUT_FILTER_MODE: ${{ inputs.filter_mode }}
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_RUBOCOP_VERSION: ${{ inputs.rubocop_version }}
INPUT_RUBOCOP_EXTENSIONS: ${{ inputs.rubocop_extensions }}
INPUT_RUBOCOP_FLAGS: ${{ inputs.rubocop_flags }}
INPUT_TOOL_NAME: ${{ inputs.tool_name }}
INPUT_LEVEL: ${{ inputs.level }}
INPUT_REPORTER: ${{ inputs.reporter }}
INPUT_FILTER_MODE: ${{ inputs.filter_mode }}
INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }}
INPUT_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }}
INPUT_WORKDIR: ${{ inputs.workdir }}
INPUT_RUBOCOP_EXTENSIONS: ${{ inputs.rubocop_extensions }}
INPUT_RUBOCOP_FLAGS: ${{ inputs.rubocop_flags }}
INPUT_RUBOCOP_VERSION: ${{ inputs.rubocop_version }}
INPUT_SKIP_INSTALL: ${{ inputs.skip_install }}
INPUT_TOOL_NAME: ${{ inputs.tool_name }}
INPUT_USE_BUNDLER: ${{ inputs.use_bundler }}
INPUT_WORKDIR: ${{ inputs.workdir }}
branding:
icon: 'check-circle'
color: 'red'

0 comments on commit 6c175bc

Please sign in to comment.